summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/app.c b/src/app.c
index e5f9a41c..bdc3a733 100644
--- a/src/app.c
+++ b/src/app.c
@@ -3364,25 +3364,32 @@ void openInDefaultBrowser_App(const iString *url) {
3364 return; 3364 return;
3365 } 3365 }
3366#endif 3366#endif
3367#if !defined (iPlatformAppleMobile) 3367#if defined (iPlatformAppleMobile)
3368 if (equalCase_Rangecc(urlScheme_String(url), "file")) {
3369 revealPath_App(collect_String(localFilePathFromUrl_String(url)));
3370 }
3371 return;
3372#endif
3368 iProcess *proc = new_Process(); 3373 iProcess *proc = new_Process();
3369 setArguments_Process(proc, 3374 setArguments_Process(proc, iClob(newStringsCStr_StringList(
3370#if defined (iPlatformAppleDesktop) 3375#if defined (iPlatformAppleDesktop)
3371 iClob(newStringsCStr_StringList("/usr/bin/env", "open", cstr_String(url), NULL)) 3376 "/usr/bin/env",
3377 "open",
3378 cstr_String(url),
3372#elif defined (iPlatformLinux) || defined (iPlatformOther) || defined (iPlatformHaiku) 3379#elif defined (iPlatformLinux) || defined (iPlatformOther) || defined (iPlatformHaiku)
3373 iClob(newStringsCStr_StringList("/usr/bin/env", "xdg-open", cstr_String(url), NULL)) 3380 "/usr/bin/env",
3381 "xdg-open",
3382 cstr_String(url),
3374#elif defined (iPlatformMsys) 3383#elif defined (iPlatformMsys)
3375 iClob(newStringsCStr_StringList( 3384 concatPath_CStr(cstr_String(execPath_App()), "../urlopen.bat"),
3376 concatPath_CStr(cstr_String(execPath_App()), "../urlopen.bat"), 3385 cstr_String(url),
3377 cstr_String(url),
3378 NULL))
3379 /* TODO: The prompt window is shown momentarily... */ 3386 /* TODO: The prompt window is shown momentarily... */
3380#endif 3387#endif
3388 NULL))
3381 ); 3389 );
3382 start_Process(proc); 3390 start_Process(proc);
3383 waitForFinished_Process(proc); /* TODO: test on Windows */ 3391 waitForFinished_Process(proc); /* TODO: test on Windows */
3384 iRelease(proc); 3392 iRelease(proc);
3385#endif
3386} 3393}
3387 3394
3388void revealPath_App(const iString *path) { 3395void revealPath_App(const iString *path) {
@@ -3392,6 +3399,9 @@ void revealPath_App(const iString *path) {
3392 proc, iClob(newStringsCStr_StringList("/usr/bin/open", "-R", cstr_String(path), NULL))); 3399 proc, iClob(newStringsCStr_StringList("/usr/bin/open", "-R", cstr_String(path), NULL)));
3393 start_Process(proc); 3400 start_Process(proc);
3394 iRelease(proc); 3401 iRelease(proc);
3402#elif defined (iPlatformAppleMobile)
3403 /* Use a share sheet. */
3404 openFileActivityView_iOS(path);
3395#elif defined (iPlatformLinux) || defined (iPlatformHaiku) 3405#elif defined (iPlatformLinux) || defined (iPlatformHaiku)
3396 iFileInfo *inf = iClob(new_FileInfo(path)); 3406 iFileInfo *inf = iClob(new_FileInfo(path));
3397 iRangecc target; 3407 iRangecc target;