aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-shell-window-commands.c51
2 files changed, 33 insertions, 25 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c6320aaa32..d5745789e8 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-06 Pratik V. Parikh <pratikvp@despammed.com>
+
+ * e-shell-window-commands.c (command_quick_reference): Check that
+ app is not NULL before trying to open the quickref document.
+
+ Fixes #55106
+
2004-02-15 Rodney Dawes <dobey@ximian.com>
* evolution-nognome.in: Use @BASE_VERSION@ for the binary
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 8ce97a7940..39f6390b68 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -188,7 +188,6 @@ command_quick_reference (BonoboUIComponent *uih,
{
char *quickref;
char *uri;
- char *mimetype;
char *command;
GString *str;
GnomeVFSMimeApplication *app;
@@ -205,35 +204,37 @@ 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)) {
- mimetype = gnome_vfs_get_mime_type (quickref);
- app = gnome_vfs_mime_get_default_application (mimetype);
- 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;
+ 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);
+ gnome_vfs_mime_application_free (app);
}
- 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);
return;
}
+
g_free (quickref);
}
}