Lagrange [work/v1.12]

Default set of bookmarks for first run

=> 9adb3b5f7ed3688e0b7347e29967154df72ab999

diff --git a/src/app.c b/src/app.c
index f5294cb0..36388062 100644
--- a/src/app.c
+++ b/src/app.c
@@ -286,6 +286,7 @@ static void saveState_App_(const iApp *d) {
 }
 
 static void init_App_(iApp *d, int argc, char **argv) {
+    const iBool isFirstRun = !fileExistsCStr_FileInfo(cleanedPath_CStr(dataDir_App_));
     d->isFinishedLaunching = iFalse;
     d->launchCommands      = new_StringList();
     iZap(d->lastDropTime);
@@ -316,6 +317,29 @@ static void init_App_(iApp *d, int argc, char **argv) {
     loadPrefs_App_(d);
     load_Visited(d->visited, dataDir_App_);
     load_Bookmarks(d->bookmarks, dataDir_App_);
+    if (isFirstRun) {
+        /* Create the default bookmarks for a quick start. */
+        add_Bookmarks(d->bookmarks,
+                      collectNewCStr_String("gemini://gemini.circumlunar.space/"),
+                      collectNewCStr_String("Project Gemini"),
+                      NULL,
+                      0x264a /* Gemini symbol */);
+        add_Bookmarks(d->bookmarks,
+                      collectNewCStr_String("gemini://gemini.circumlunar.space/capcom/"),
+                      collectNewCStr_String("CAPCOM Geminispace aggregator"),
+                      NULL,
+                      0x264a /* Gemini symbol */);
+        add_Bookmarks(d->bookmarks,
+                      collectNewCStr_String("gemini://gus.guru/"),
+                      collectNewCStr_String("GUS - Gemini Universal Search"),
+                      NULL,
+                      0x2690);
+        add_Bookmarks(d->bookmarks,
+                      collectNewCStr_String("gemini://skyjake.fi/lagrange/"),
+                      collectNewCStr_String("Lagrange"),
+                      NULL,
+                      0x1f306);
+    }
 #if defined (iHaveLoadEmbed)
     /* Load the resources from a file. */ {
         if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) {
diff --git a/src/bookmarks.c b/src/bookmarks.c
index 6a5eb296..8fe7d109 100644
--- a/src/bookmarks.c
+++ b/src/bookmarks.c
@@ -145,7 +145,7 @@ void add_Bookmarks(iBookmarks *d, const iString *url, const iString *title, cons
     iBookmark *bm = new_Bookmark();
     set_String(&bm->url, url);
     set_String(&bm->title, title);
-    set_String(&bm->tags, tags);
+    if (tags) set_String(&bm->tags, tags);
     bm->icon = icon;
     initCurrent_Time(&bm->when);
     insert_Bookmarks_(d, bm);
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.12/cdiff/9adb3b5f7ed3688e0b7347e29967154df72ab999
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
56.041268 milliseconds
Gemini-to-HTML Time
0.216815 milliseconds

This content has been proxied by September (ba2dc).