diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -612,13 +612,14 @@ enum iColorTheme colorTheme_App(void) { | |||
612 | 612 | ||
613 | const iString *schemeProxy_App(iRangecc scheme) { | 613 | const iString *schemeProxy_App(iRangecc scheme) { |
614 | iApp *d = &app_; | 614 | iApp *d = &app_; |
615 | const iString *proxy = NULL; | ||
615 | if (equalCase_Rangecc(scheme, "gopher")) { | 616 | if (equalCase_Rangecc(scheme, "gopher")) { |
616 | return &d->prefs.gopherProxy; | 617 | proxy = &d->prefs.gopherProxy; |
617 | } | 618 | } |
618 | if (equalCase_Rangecc(scheme, "http") || equalCase_Rangecc(scheme, "https")) { | 619 | if (equalCase_Rangecc(scheme, "http") || equalCase_Rangecc(scheme, "https")) { |
619 | return &d->prefs.httpProxy; | 620 | proxy = &d->prefs.httpProxy; |
620 | } | 621 | } |
621 | return NULL; | 622 | return !isEmpty_String(proxy) ? proxy : NULL; |
622 | } | 623 | } |
623 | 624 | ||
624 | int run_App(int argc, char **argv) { | 625 | int run_App(int argc, char **argv) { |
@@ -884,15 +885,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
884 | } | 885 | } |
885 | 886 | ||
886 | iBool willUseProxy_App(const iRangecc scheme) { | 887 | iBool willUseProxy_App(const iRangecc scheme) { |
887 | iApp *d = &app_; | 888 | return schemeProxy_App(scheme) != NULL; |
888 | if (!isEmpty_String(&d->prefs.httpProxy) && (equalCase_Rangecc(scheme, "http") || | ||
889 | equalCase_Rangecc(scheme, "https"))) { | ||
890 | return iTrue; | ||
891 | } | ||
892 | if (!isEmpty_String(&d->prefs.gopherProxy) && equalCase_Rangecc(scheme, "gopher")) { | ||
893 | return iTrue; | ||
894 | } | ||
895 | return iFalse; | ||
896 | } | 889 | } |
897 | 890 | ||
898 | iBool handleCommand_App(const char *cmd) { | 891 | iBool handleCommand_App(const char *cmd) { |
@@ -1203,6 +1196,10 @@ iBool handleCommand_App(const char *cmd) { | |||
1203 | save_Bookmarks(d->bookmarks, dataDir_App_); | 1196 | save_Bookmarks(d->bookmarks, dataDir_App_); |
1204 | return iFalse; | 1197 | return iFalse; |
1205 | } | 1198 | } |
1199 | else if (equal_Command(cmd, "visited.changed")) { | ||
1200 | save_Visited(d->visited, dataDir_App_); | ||
1201 | return iFalse; | ||
1202 | } | ||
1206 | else if (equal_Command(cmd, "ident.new")) { | 1203 | else if (equal_Command(cmd, "ident.new")) { |
1207 | iWidget *dlg = makeIdentityCreation_Widget(); | 1204 | iWidget *dlg = makeIdentityCreation_Widget(); |
1208 | setCommandHandler_Widget(dlg, handleIdentityCreationCommands_); | 1205 | setCommandHandler_Widget(dlg, handleIdentityCreationCommands_); |