[nautilus/wip/alexpandelea/tags: 1/15] files-view: disable create-link when the clipboard is empty



commit b729dcfd0aeec2be516facb30fdee59223a58124
Author: Tiberiu Lepadatu <tiberiulepadatu14 gmail com>
Date:   Sun Apr 9 14:00:19 2017 +0300

    files-view: disable create-link when the clipboard is empty
    
    'Create Link' button does nothing when the clipboard is empty. In order to fix
    that, disable the button when the clipboard is empty.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781095

 src/nautilus-files-view.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 1874d8b..89edede 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7098,7 +7098,8 @@ on_clipboard_contents_received (GtkClipboard     *clipboard,
     is_read_only = nautilus_files_view_is_read_only (view);
     selection_contains_recent = showing_recent_directory (view);
     can_link_from_copied_files = !nautilus_clipboard_is_cut_from_selection_data (selection_data) &&
-                                 !selection_contains_recent && !is_read_only;
+                                 !selection_contains_recent && !is_read_only &&
+                                 gtk_selection_data_get_length (selection_data) > 0;
 
     action = g_action_map_lookup_action (G_ACTION_MAP (priv->view_action_group),
                                          "create-link");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]