summaryrefslogtreecommitdiffstats
path: root/system/pcmanfm/patches/0002-3586151-Open-in-.-actions-should-be-available-only-f.patch
blob: 217802a13abf9beb71e74e35cb0f990970a0d5de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From f53d9b1c4f47b56c8c726a9ea8c070e6bdfc8a12 Mon Sep 17 00:00:00 2001
From: Andriy Grytsenko <andrej@rep.kiev.ua>
Date: Mon, 12 Nov 2012 22:26:18 +0200
Subject: [PATCH 02/11] [#3586151]'Open in ...' actions should be available
 only for directories.

Added check if all selected items are directories and if not
then don't add those items into popup.
---
 src/tab-page.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/tab-page.c b/src/tab-page.c
index 1c79b94..29a4192 100644
--- a/src/tab-page.c
+++ b/src/tab-page.c
@@ -433,6 +433,11 @@ static void update_files_popup(FmFolderView* fv, GtkWindow* win,
                                GtkUIManager* ui, GtkActionGroup* act_grp,
                                FmFileInfoList* files)
 {
+    GList* l;
+
+    for(l = fm_file_info_list_peek_head_link(files); l; l = l->next)
+        if(!fm_file_info_is_dir(l->data))
+            return; /* actions are valid only if all selected are directories */
     gtk_action_group_set_translation_domain(act_grp, NULL);
     gtk_action_group_add_actions(act_grp, folder_menu_actions,
                                  G_N_ELEMENTS(folder_menu_actions), win);
-- 
1.8.0.1