diff options
author | Rodney Dawes <dobey@ximian.com> | 2004-02-07 01:24:25 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-02-07 01:24:25 +0800 |
commit | 5868c475f966ee06afa7cf17296c1f85e0434dc8 (patch) | |
tree | 4882a5a1af3718e53f8b03a89329567b65ab4060 /shell/e-shell-window-commands.c | |
parent | 34788ccca7c1fc0a9efda7686e95a572b21a12f0 (diff) | |
download | gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.gz gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.zst gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.zip |
Really make this work with gnome-vfs 2.2, instead of using gnome-vfs 2.4
2004-02-06 Rodney Dawes <dobey@ximian.com>
* e-shell-window-commands.c (command_quick_reference): Really make
this work with gnome-vfs 2.2, instead of using gnome-vfs 2.4 api,
fixes #53566 more completely so snapshots can build again (doh)
svn path=/trunk/; revision=24650
Diffstat (limited to 'shell/e-shell-window-commands.c')
-rw-r--r-- | shell/e-shell-window-commands.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index 15676de2f7..8ce97a7940 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -189,8 +189,9 @@ command_quick_reference (BonoboUIComponent *uih, char *quickref; char *uri; char *mimetype; + char *command; + GString *str; GnomeVFSMimeApplication *app; - GList * uri_list; const GList *lang_list = gnome_i18n_get_language_list ("LC_MESSAGES"); for (; lang_list != NULL; lang_list = lang_list->next) { @@ -204,16 +205,33 @@ command_quick_reference (BonoboUIComponent *uih, quickref = g_build_filename (EVOLUTION_HELPDIR, "quickref", lang, "quickref.pdf", NULL); if (g_file_test (quickref, G_FILE_TEST_EXISTS)) { - uri = g_strconcat ("file://", quickref, NULL); - mimetype = gnome_vfs_get_mime_type (uri); + mimetype = gnome_vfs_get_mime_type (quickref); app = gnome_vfs_mime_get_default_application (mimetype); - uri_list = g_list_append (NULL, uri); - gnome_vfs_mime_application_launch (app, uri_list); - g_list_free (uri_list); + str = g_string_new (""); + str = g_string_append (str, app->command); + + switch (app->expects_uris) { + case GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS: + uri = g_strconcat ("file://", quickref, NULL); + g_string_append_printf (str, " %s", uri); + g_free (uri); + break; + case GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_PATHS: + case GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS_FOR_NON_FILES: + g_string_append_printf (str, " %s", quickref); + break; + } + + command = g_string_free (str, FALSE); + if (command != NULL && + !g_spawn_command_line_async (command, NULL)) { + g_warning ("Could not launch %s", command); + } + g_free (command); + gnome_vfs_mime_application_free (app); g_free (mimetype); g_free (quickref); - g_free (uri); return; } g_free (quickref); |