From a369d4a8d8563fd94195afeeb8e0f6b8d26dfa79 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 12 Mar 1999 02:43:26 +0000 Subject: [PATCH] 1999-03-11 Miguel de Icaza * gpopup2.c (gpopup_do_popup2): Until Federico look over this, I am fixing this crash. --- gnome/ChangeLog | 13 +++++++++++++ gnome/gaction.c | 15 ++------------- gnome/gpopup2.c | 27 ++++----------------------- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 4c972b9e1..2c50a6050 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,16 @@ +1999-03-11 Miguel de Icaza + + * gpopup2.c (gpopup_do_popup2): Until Federico look over this, I + am fixing this crash. + +1999-03-11 Miguel de Icaza + + * gpopup2.c: Sigh. It happened again. More features killed by + the merge. + + If a file does not have any metadata/mime way of viewing it, the + viewer will always work. + 1999-03-11 Federico Mena Quintero * gdesktop.c (text_changed): Rename the metadata and refresh the diff --git a/gnome/gaction.c b/gnome/gaction.c index 2befc8c57..63ee8385d 100644 --- a/gnome/gaction.c +++ b/gnome/gaction.c @@ -230,18 +230,6 @@ gmc_view_command (gchar *filename) } return NULL; } -gboolean -gmc_can_view_file (char *filename) -{ - char *cmd; - - cmd = gmc_view_command (filename); - if (cmd) { - g_free (cmd); - return 1; - } - return 0; -} int gmc_view (char *filename, int start_line) @@ -253,6 +241,7 @@ gmc_view (char *filename, int start_line) gmc_run_view (filename, cmd); g_free (cmd); return 1; - } + } else + view (NULL, filename, 0, 0); return 0; } diff --git a/gnome/gpopup2.c b/gnome/gpopup2.c index 06224d686..cfb4cfec4 100644 --- a/gnome/gpopup2.c +++ b/gnome/gpopup2.c @@ -182,26 +182,6 @@ check_eject_func (WPanel *panel, DesktopIconInfo *dii) return retval; } -static gboolean -check_edit_func (WPanel *panel, DesktopIconInfo *dii) -{ - /* As far as I can tell, by looking at gactions.c, edit will _ALWAYS work */ - return TRUE; -} - -static gboolean -check_view_func (WPanel *panel, DesktopIconInfo *dii) -{ - gchar *full_name; - if (is_a_desktop_panel (panel)) { - g_assert (dii != NULL); - full_name = g_concat_dir_and_file (panel->cwd, dii->filename); - } else - full_name = g_concat_dir_and_file (panel->cwd, panel->dir.list[panel->selected].fname); - - return gmc_can_view_file (full_name); -} - /* global vars */ extern int we_can_afford_the_speed; @@ -213,9 +193,9 @@ static struct action file_actions[] = { { "", F_NOTDEV | F_SINGLE, NULL, NULL }, { "", F_MIME_ACTIONS | F_SINGLE, NULL, NULL }, { N_("Open with..."), F_REGULAR | F_SINGLE, handle_open_with, NULL }, - { N_("View"), F_REGULAR | F_SINGLE, handle_view, check_view_func }, + { N_("View"), F_REGULAR | F_SINGLE, handle_view, NULL }, { N_("View Unfiltered"), F_REGULAR | F_ADVANCED | F_SINGLE, handle_view_unfiltered, NULL }, - { N_("Edit"), F_REGULAR | F_SINGLE, handle_edit, check_edit_func }, + { N_("Edit"), F_REGULAR | F_SINGLE, handle_edit, NULL }, { "", F_REGULAR | F_SINGLE, NULL, NULL }, { N_("Copy..."), F_ALL, handle_copy, NULL }, { N_("Delete"), F_ALL, handle_delete, NULL }, @@ -570,7 +550,8 @@ gpopup_do_popup2 (GdkEventButton *event, WPanel *panel, DesktopIconInfo *dii) REMOVE (flags, F_NOTDEV); } - g_assert (marked > 0); + if (market == 0) + return; if (marked > 1) REMOVE (flags, F_SINGLE);