diff options
author | Razvan Chitu <razvan.ch95@gmail.com> | 2015-12-23 11:24:55 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-12-23 10:43:59 +0100 |
commit | 37053e77234ea3070e5db14510c6d7108d2af483 (patch) | |
tree | 9d64d6b7d3c2659a08e6c12d5f48d2818d91fb6a | |
parent | f35e9087da22f5c3898cb09f6cd1dc7b816df76b (diff) | |
download | nautilus-37053e77234ea3070e5db14510c6d7108d2af483.tar.gz |
files-view: disable create link if clipboard empty
This fixes an oversight in commit 0eef086.
https://bugzilla.gnome.org/show_bug.cgi?id=745575
-rw-r--r-- | src/nautilus-files-view.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 996053177..32be4da94 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -6014,12 +6014,12 @@ clipboard_targets_received (GtkClipboard *clipboard, gpointer user_data) { NautilusFilesView *view; - gboolean can_paste; + gboolean is_data_copied; int i; GAction *action; view = NAUTILUS_FILES_VIEW (user_data); - can_paste = FALSE; + is_data_copied = FALSE; if (view->details->slot == NULL || !view->details->active) { @@ -6031,7 +6031,7 @@ clipboard_targets_received (GtkClipboard *clipboard, if (targets) { for (i = 0; i < n_targets; i++) { if (targets[i] == copied_files_atom) { - can_paste = TRUE; + is_data_copied = TRUE; } } } @@ -6041,13 +6041,19 @@ clipboard_targets_received (GtkClipboard *clipboard, /* Take into account if the action was previously disabled for other reasons, * like the directory not being writabble */ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), - can_paste && g_action_get_enabled (action)); + is_data_copied && g_action_get_enabled (action)); action = g_action_map_lookup_action (G_ACTION_MAP (view->details->view_action_group), "paste-into"); g_simple_action_set_enabled (G_SIMPLE_ACTION (action), - can_paste && g_action_get_enabled (action)); + is_data_copied && g_action_get_enabled (action)); + + action = g_action_map_lookup_action (G_ACTION_MAP (view->details->view_action_group), + "create-link"); + + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), + is_data_copied && g_action_get_enabled (action)); g_object_unref (view); } |