aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorRodney Dawes <dobey@ximian.com>2004-02-07 01:24:25 +0800
committerRodney Dawes <dobey@src.gnome.org>2004-02-07 01:24:25 +0800
commit5868c475f966ee06afa7cf17296c1f85e0434dc8 (patch)
tree4882a5a1af3718e53f8b03a89329567b65ab4060 /shell
parent34788ccca7c1fc0a9efda7686e95a572b21a12f0 (diff)
downloadgsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar
gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.gz
gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.bz2
gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.lz
gsoc2013-evolution-5868c475f966ee06afa7cf17296c1f85e0434dc8.tar.xz
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')
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-shell-window-commands.c32
2 files changed, 31 insertions, 7 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 3911be4911..916ca5873b 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,9 @@
+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)
+
2004-02-06 JP Rosevear <jpr@ximian.com>
* importer/import.glade: remove step numbers
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);