diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-04 16:04:50 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-04 16:04:50 +0200 |
commit | b20be8d7f701f364d7199a494c25c2694e40864d (patch) | |
tree | 4138cca208aa73eeb3658c3dc8e82b8c03e9b78d /src/app.c | |
parent | b17bbaefed9a12046d2c9874cd9b200edacbccf6 (diff) |
Windows: Improvements to file URL/path handling
IssueID #23
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -362,7 +362,7 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
362 | loadPrefs_App_(d); | 362 | loadPrefs_App_(d); |
363 | load_Keys(dataDir_App_); | 363 | load_Keys(dataDir_App_); |
364 | load_Visited(d->visited, dataDir_App_); | 364 | load_Visited(d->visited, dataDir_App_); |
365 | load_Bookmarks(d->bookmarks, dataDir_App_); | 365 | load_Bookmarks(d->bookmarks, dataDir_App_); |
366 | if (isFirstRun) { | 366 | if (isFirstRun) { |
367 | /* Create the default bookmarks for a quick start. */ | 367 | /* Create the default bookmarks for a quick start. */ |
368 | add_Bookmarks(d->bookmarks, | 368 | add_Bookmarks(d->bookmarks, |
@@ -417,10 +417,10 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
417 | startsWithCase_String(arg, "gemini:") || startsWithCase_String(arg, "file:") || | 417 | startsWithCase_String(arg, "gemini:") || startsWithCase_String(arg, "file:") || |
418 | startsWithCase_String(arg, "data:") || startsWithCase_String(arg, "about:"); | 418 | startsWithCase_String(arg, "data:") || startsWithCase_String(arg, "about:"); |
419 | if (isKnownScheme || fileExists_FileInfo(arg)) { | 419 | if (isKnownScheme || fileExists_FileInfo(arg)) { |
420 | postCommandf_App("open newtab:%d url:%s%s", | 420 | postCommandf_App("open newtab:%d url:%s", |
421 | newTab, | 421 | newTab, |
422 | isKnownScheme ? "" : "file://", | 422 | isKnownScheme ? cstr_String(arg) |
423 | cstr_String(arg)); | 423 | : cstrCollect_String(makeFileUrl_String(arg))); |
424 | newTab = iTrue; | 424 | newTab = iTrue; |
425 | } | 425 | } |
426 | } | 426 | } |
@@ -501,7 +501,8 @@ void processEvents_App(enum iAppEventMode eventMode) { | |||
501 | postCommandf_App("~open newtab:%d url:%s", newTab, ev.drop.file); | 501 | postCommandf_App("~open newtab:%d url:%s", newTab, ev.drop.file); |
502 | } | 502 | } |
503 | else { | 503 | else { |
504 | postCommandf_App("~open newtab:%d url:file://%s", newTab, ev.drop.file); | 504 | postCommandf_App( |
505 | "~open newtab:%d url:%s", newTab, makeFileUrl_CStr(ev.drop.file)); | ||
505 | } | 506 | } |
506 | break; | 507 | break; |
507 | } | 508 | } |
@@ -908,7 +909,7 @@ iBool handleCommand_App(const char *cmd) { | |||
908 | postCommand_App("font.changed"); | 909 | postCommand_App("font.changed"); |
909 | postCommand_App("window.unfreeze"); | 910 | postCommand_App("window.unfreeze"); |
910 | return iTrue; | 911 | return iTrue; |
911 | } | 912 | } |
912 | else if (equal_Command(cmd, "zoom.set")) { | 913 | else if (equal_Command(cmd, "zoom.set")) { |
913 | setFreezeDraw_Window(get_Window(), iTrue); /* no intermediate draws before docs updated */ | 914 | setFreezeDraw_Window(get_Window(), iTrue); /* no intermediate draws before docs updated */ |
914 | d->prefs.zoomPercent = arg_Command(cmd); | 915 | d->prefs.zoomPercent = arg_Command(cmd); |