diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-13 17:40:13 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-13 17:40:13 +0300 |
commit | 9adb3b5f7ed3688e0b7347e29967154df72ab999 (patch) | |
tree | f3a86535b2c9753b82f0bde3830958d31e8550dc /src | |
parent | 896eb14063b7cd19cb103bd1c48d4a0781bf25a4 (diff) |
Default set of bookmarks for first run
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 24 | ||||
-rw-r--r-- | src/bookmarks.c | 2 |
2 files changed, 25 insertions, 1 deletions
@@ -286,6 +286,7 @@ static void saveState_App_(const iApp *d) { | |||
286 | } | 286 | } |
287 | 287 | ||
288 | static void init_App_(iApp *d, int argc, char **argv) { | 288 | static void init_App_(iApp *d, int argc, char **argv) { |
289 | const iBool isFirstRun = !fileExistsCStr_FileInfo(cleanedPath_CStr(dataDir_App_)); | ||
289 | d->isFinishedLaunching = iFalse; | 290 | d->isFinishedLaunching = iFalse; |
290 | d->launchCommands = new_StringList(); | 291 | d->launchCommands = new_StringList(); |
291 | iZap(d->lastDropTime); | 292 | iZap(d->lastDropTime); |
@@ -316,6 +317,29 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
316 | loadPrefs_App_(d); | 317 | loadPrefs_App_(d); |
317 | load_Visited(d->visited, dataDir_App_); | 318 | load_Visited(d->visited, dataDir_App_); |
318 | load_Bookmarks(d->bookmarks, dataDir_App_); | 319 | load_Bookmarks(d->bookmarks, dataDir_App_); |
320 | if (isFirstRun) { | ||
321 | /* Create the default bookmarks for a quick start. */ | ||
322 | add_Bookmarks(d->bookmarks, | ||
323 | collectNewCStr_String("gemini://gemini.circumlunar.space/"), | ||
324 | collectNewCStr_String("Project Gemini"), | ||
325 | NULL, | ||
326 | 0x264a /* Gemini symbol */); | ||
327 | add_Bookmarks(d->bookmarks, | ||
328 | collectNewCStr_String("gemini://gemini.circumlunar.space/capcom/"), | ||
329 | collectNewCStr_String("CAPCOM Geminispace aggregator"), | ||
330 | NULL, | ||
331 | 0x264a /* Gemini symbol */); | ||
332 | add_Bookmarks(d->bookmarks, | ||
333 | collectNewCStr_String("gemini://gus.guru/"), | ||
334 | collectNewCStr_String("GUS - Gemini Universal Search"), | ||
335 | NULL, | ||
336 | 0x2690); | ||
337 | add_Bookmarks(d->bookmarks, | ||
338 | collectNewCStr_String("gemini://skyjake.fi/lagrange/"), | ||
339 | collectNewCStr_String("Lagrange"), | ||
340 | NULL, | ||
341 | 0x1f306); | ||
342 | } | ||
319 | #if defined (iHaveLoadEmbed) | 343 | #if defined (iHaveLoadEmbed) |
320 | /* Load the resources from a file. */ { | 344 | /* Load the resources from a file. */ { |
321 | if (!load_Embed(concatPath_CStr(cstr_String(execPath_App()), EMB_BIN))) { | 345 | 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 | |||
145 | iBookmark *bm = new_Bookmark(); | 145 | iBookmark *bm = new_Bookmark(); |
146 | set_String(&bm->url, url); | 146 | set_String(&bm->url, url); |
147 | set_String(&bm->title, title); | 147 | set_String(&bm->title, title); |
148 | set_String(&bm->tags, tags); | 148 | if (tags) set_String(&bm->tags, tags); |
149 | bm->icon = icon; | 149 | bm->icon = icon; |
150 | initCurrent_Time(&bm->when); | 150 | initCurrent_Time(&bm->when); |
151 | insert_Bookmarks_(d, bm); | 151 | insert_Bookmarks_(d, bm); |