aboutsummaryrefslogtreecommitdiff
path: root/libsylph/utils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-25 06:34:07 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-25 06:34:07 +0000
commit070e412f18875b74e329d932d65b2917d8d81bd7 (patch)
tree9a892d712cf507a9bcef1df2a65481020c3b9427 /libsylph/utils.c
parentb81cb2016a3fb6bb6f297a057516aac13e5bcf42 (diff)
use 'open' command on OS X.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2847 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/utils.c')
-rw-r--r--libsylph/utils.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 8026cc28..3b1301a8 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -4097,9 +4097,9 @@ gint execute_command_line_async_wait(const gchar *cmdline)
gint execute_open_file(const gchar *file, const gchar *content_type)
{
+#ifdef G_OS_WIN32
g_return_val_if_fail(file != NULL, -1);
-#ifdef G_OS_WIN32
log_print("opening %s - %s\n", file, content_type ? content_type : "");
if (G_WIN32_HAVE_WIDECHAR_API()) {
@@ -4127,7 +4127,17 @@ gint execute_open_file(const gchar *file, const gchar *content_type)
return 0;
}
+#elif defined(__APPLE__)
+ const gchar *argv[3] = {"open", NULL, NULL};
+
+ g_return_val_if_fail(file != NULL, -1);
+
+ log_print("opening %s - %s\n", file, content_type ? content_type : "");
+
+ argv[1] = file;
+ execute_async(argv);
#endif
+
return 0;
}
@@ -4192,7 +4202,7 @@ gint open_uri(const gchar *uri, const gchar *cmdline)
g_return_val_if_fail(uri != NULL, -1);
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__APPLE__)
if (!cmdline || cmdline[0] == '\0')
return execute_open_file(uri, NULL);
#endif