diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2005-02-23 15:01:27 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-02-23 15:01:27 +0800 |
commit | 3284b5f24aaa92360f09cffb28be6a26e5f8ba86 (patch) | |
tree | 52ca9ebe0724fb914154c07fc748fba22d747400 /shell/e-shell-window-commands.c | |
parent | 8736c6d840daeeb44716802f4af88892b5ad2615 (diff) | |
download | gsoc2013-evolution-3284b5f24aaa92360f09cffb28be6a26e5f8ba86.tar.gz gsoc2013-evolution-3284b5f24aaa92360f09cffb28be6a26e5f8ba86.tar.zst gsoc2013-evolution-3284b5f24aaa92360f09cffb28be6a26e5f8ba86.zip |
Use gnome-vfs API to open quick reference in the pdf viewer
2005-02-22 Marco Pesenti Gritti <marco@gnome.org>
* shell/e-shell-window-commands.c: (command_quick_reference):
Use gnome-vfs API to open quick reference in the pdf viewer
svn path=/trunk/; revision=28863
Diffstat (limited to 'shell/e-shell-window-commands.c')
-rw-r--r-- | shell/e-shell-window-commands.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index c6a7ded294..438e5c50cd 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -44,6 +44,7 @@ #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgnomevfs/gnome-vfs-mime-utils.h> +#include <libgnomevfs/gnome-vfs-utils.h> #include <bonobo/bonobo-ui-component.h> @@ -486,9 +487,6 @@ command_quick_reference (BonoboUIComponent *uih, const char *path) { char *quickref; - char *uri; - char *command; - GString *str; GnomeVFSMimeApplication *app; const GList *lang_list = gnome_i18n_get_language_list ("LC_MESSAGES"); @@ -504,29 +502,18 @@ 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)) { app = gnome_vfs_mime_get_default_application ("application/pdf"); + if (app) { - 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); + GList *uris = NULL; + char *uri; + + uri = gnome_vfs_get_uri_from_local_path (quickref); + uris = g_list_append (uris, uri); + + gnome_vfs_mime_application_launch (app, uris); + + g_free (uri); + g_list_free (uris); gnome_vfs_mime_application_free (app); } |