diff options
-rw-r--r-- | src/app.c | 18 | ||||
-rw-r--r-- | src/history.c | 4 | ||||
-rw-r--r-- | src/history.h | 3 |
3 files changed, 15 insertions, 10 deletions
@@ -342,6 +342,7 @@ iBool handleCommand_App(const char *cmd) { | |||
342 | init_Url(&parts, url); | 342 | init_Url(&parts, url); |
343 | if (equalCase_Rangecc(&parts.protocol, "http") || | 343 | if (equalCase_Rangecc(&parts.protocol, "http") || |
344 | equalCase_Rangecc(&parts.protocol, "https")) { | 344 | equalCase_Rangecc(&parts.protocol, "https")) { |
345 | visitUrl_History(d->history, url); | ||
345 | openInDefaultBrowser_App(url); | 346 | openInDefaultBrowser_App(url); |
346 | return iTrue; | 347 | return iTrue; |
347 | } | 348 | } |
@@ -427,16 +428,15 @@ iBool handleCommand_App(const char *cmd) { | |||
427 | 428 | ||
428 | void openInDefaultBrowser_App(const iString *url) { | 429 | void openInDefaultBrowser_App(const iString *url) { |
429 | iProcess *proc = new_Process(); | 430 | iProcess *proc = new_Process(); |
430 | #if defined (iPlatformApple) | ||
431 | setArguments_Process(proc, | ||
432 | iClob(newStringsCStr_StringList("/usr/bin/open", cstr_String(url), NULL))); | ||
433 | start_Process(proc); | ||
434 | #elif defined(iPlatformLinux) | ||
435 | setArguments_Process(proc, | 431 | setArguments_Process(proc, |
436 | iClob(newStringsCStr_StringList("/usr/bin/x-www-browser", cstr_String(url), NULL))); | 432 | #if defined (iPlatformApple) |
437 | start_Process(proc); | 433 | iClob(newStringsCStr_StringList("/usr/bin/open", cstr_String(url), NULL)) |
438 | #else | 434 | #elif defined (iPlatformLinux) |
439 | iAssert(iFalse); | 435 | iClob(newStringsCStr_StringList("/usr/bin/x-www-browser", cstr_String(url), NULL)) |
436 | #elif defined (iPlatformMsys) | ||
437 | iClob(newStringsCStr_StringList("start", cstr_String(url), NULL)) | ||
440 | #endif | 438 | #endif |
439 | ); | ||
440 | start_Process(proc); | ||
441 | iRelease(proc); | 441 | iRelease(proc); |
442 | } | 442 | } |
diff --git a/src/history.c b/src/history.c index ca80ad3f..de0c36ca 100644 --- a/src/history.c +++ b/src/history.c | |||
@@ -194,6 +194,10 @@ void addUrl_History(iHistory *d, const iString *url ){ | |||
194 | addVisited_History_(d, url); | 194 | addVisited_History_(d, url); |
195 | } | 195 | } |
196 | 196 | ||
197 | void visitUrl_History(iHistory *d, const iString *url) { | ||
198 | addVisited_History_(d, url); | ||
199 | } | ||
200 | |||
197 | iBool goBack_History(iHistory *d) { | 201 | iBool goBack_History(iHistory *d) { |
198 | if (d->stackPos < size_Array(&d->stack) - 1) { | 202 | if (d->stackPos < size_Array(&d->stack) - 1) { |
199 | d->stackPos++; | 203 | d->stackPos++; |
diff --git a/src/history.h b/src/history.h index 149e6b82..78394008 100644 --- a/src/history.h +++ b/src/history.h | |||
@@ -27,7 +27,8 @@ const iString * url_History (iHistory *, size_t pos); | |||
27 | iTime urlVisitTime_History(const iHistory *, const iString *url); | 27 | iTime urlVisitTime_History(const iHistory *, const iString *url); |
28 | void print_History (const iHistory *); | 28 | void print_History (const iHistory *); |
29 | 29 | ||
30 | void addUrl_History (iHistory *, const iString *url); | 30 | void addUrl_History (iHistory *, const iString *url); /* adds to the stack of recents */ |
31 | void visitUrl_History (iHistory *, const iString *url); /* adds URL to the visited URLs set */ | ||
31 | void replace_History (iHistory *, const iString *url); | 32 | void replace_History (iHistory *, const iString *url); |
32 | 33 | ||
33 | iBool goBack_History (iHistory *); | 34 | iBool goBack_History (iHistory *); |