X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fview-file%2Fview-file.cc;fp=src%2Fview-file%2Fview-file.cc;h=dc0059120fba81db8d1d62cf716b7774c6f78c92;hp=27b0c8e86aef1c70213cf4c911d02555b73f54d9;hb=fbaa7a3a0fa4d783924dc9ce692e15de9bec66fb;hpb=98b2cdbeb4fada4a4e123bf0779a11067a6deae5 diff --git a/src/view-file/view-file.cc b/src/view-file/view-file.cc index 27b0c8e8..dc005912 100644 --- a/src/view-file/view-file.cc +++ b/src/view-file/view-file.cc @@ -407,20 +407,9 @@ static void vf_pop_menu_open_archive_cb(GtkWidget *, gpointer data) { auto vf = static_cast(data); LayoutWindow *lw_new; - FileData *fd = nullptr; gchar *dest_dir; - switch (vf->type) - { - case FILEVIEW_LIST: - fd = (VFLIST(vf)->click_fd); - break; - case FILEVIEW_ICON: - fd = (VFICON(vf)->click_fd); - break; - } - - dest_dir = open_archive(fd); + dest_dir = open_archive(vf->click_fd); if (dest_dir) { lw_new = layout_new_from_default(); @@ -690,18 +679,13 @@ GtkWidget *vf_pop_menu(ViewFile *vf) gboolean class_archive = FALSE; GtkAccelGroup *accel_group; - switch (vf->type) - { - case FILEVIEW_LIST: - vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE); - active = (VFLIST(vf)->click_fd != nullptr); - class_archive = (VFLIST(vf)->click_fd != nullptr && VFLIST(vf)->click_fd->format_class == FORMAT_CLASS_ARCHIVE); - break; - case FILEVIEW_ICON: - active = (VFICON(vf)->click_fd != nullptr); - class_archive = (VFICON(vf)->click_fd != nullptr && VFICON(vf)->click_fd->format_class == FORMAT_CLASS_ARCHIVE); - break; - } + if (vf->type == FILEVIEW_LIST) + { + vflist_color_set(vf, vf->click_fd, TRUE); + } + + active = (vf->click_fd != nullptr); + class_archive = (vf->click_fd != nullptr && vf->click_fd->format_class == FORMAT_CLASS_ARCHIVE); menu = popup_menu_short_lived();