From e8150ae4a59891eab62a77302d8ff2834a2e8f39 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 23 Jul 2020 13:05:29 +0300 Subject: App: Load home.gmi from the app data dir --- src/app.c | 6 ++++++ src/ui/documentwidget.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.c b/src/app.c index 1164484e..03917f3e 100644 --- a/src/app.c +++ b/src/app.c @@ -139,6 +139,12 @@ static void init_App_(iApp *d, int argc, char **argv) { loadPrefs_App_(d); d->window = new_Window(); /* Widget state init. */ { + iString *homePath = newCStr_String(dataDir_App_); + clean_Path(homePath); + append_Path(homePath, &iStringLiteral("home.gmi")); + prependCStr_String(homePath, "file://"); + setUrl_DocumentWidget(findWidget_App("document"), homePath); + delete_String(homePath); } } diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index ca91d896..a21d660d 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -84,8 +84,6 @@ void init_DocumentWidget(iDocumentWidget *d) { init_PtrArray(&d->visibleLinks); d->hoverLink = NULL; init_Click(&d->click, d, SDL_BUTTON_LEFT); - setUrl_DocumentWidget( - d, collectNewFormat_String("file://%s/test.gmi", cstr_String(collect_String(home_Path())))); } void deinit_DocumentWidget(iDocumentWidget *d) { -- cgit v1.2.3