summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-04-12 14:05:31 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-14 10:35:17 +0200
commit191fbb46db58bffa20bfbf7b145ec7a13beb3346 (patch)
tree2d82701fa3a7595ebcc4a797aa1267ce374792d4 /src
parent391839b142322c6d165d334774a55f05bc7e221c (diff)
downloadnautilus-191fbb46db58bffa20bfbf7b145ec7a13beb3346.tar.gz
file: move special link to file instead of the view
This feels like belonging to the file itself rather than the view. https://bugzilla.gnome.org/show_bug.cgi?id=712620
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-desktop-canvas-view.c27
-rw-r--r--src/nautilus-files-view.c25
-rw-r--r--src/nautilus-files-view.h5
3 files changed, 16 insertions, 41 deletions
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index f42aa98ae..5fe8f0a12 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -69,8 +69,6 @@ static void default_zoom_level_changed (gpointer
static void real_update_context_menus (NautilusFilesView *view);
static char* real_get_backing_uri (NautilusFilesView *view);
static void real_check_empty_states (NautilusFilesView *view);
-static gboolean real_special_link_in_selection (NautilusFilesView *view,
- GList *selection);
static char * real_get_file_paths_or_uris_as_newline_delimited_string (NautilusFilesView *view,
GList *selection,
gboolean get_paths);
@@ -313,8 +311,6 @@ nautilus_desktop_canvas_view_class_init (NautilusDesktopCanvasViewClass *class)
vclass->check_empty_states = real_check_empty_states;
vclass->get_file_paths_or_uris_as_newline_delimited_string = real_get_file_paths_or_uris_as_newline_delimited_string;
- vclass->special_link_in_selection = real_special_link_in_selection;
-
g_type_class_add_private (class, sizeof (NautilusDesktopCanvasViewDetails));
}
@@ -580,29 +576,6 @@ const GActionEntry desktop_view_entries[] = {
{ "unstretch", action_unstretch },
};
-static gboolean
-real_special_link_in_selection (NautilusFilesView *view,
- GList *selection)
-{
- gboolean saw_link;
- GList *node;
- NautilusFile *file;
-
- saw_link = FALSE;
-
- for (node = selection; node != NULL; node = node->next) {
- file = NAUTILUS_FILE (node->data);
-
- saw_link = NAUTILUS_IS_DESKTOP_ICON_FILE (file);
-
- if (saw_link) {
- break;
- }
- }
-
- return saw_link;
-}
-
static void
real_check_empty_states (NautilusFilesView *view)
{
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index b701b488b..1e6a2ae8d 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4054,15 +4054,23 @@ static gboolean
nautilus_files_view_special_link_in_selection (NautilusFilesView *view,
GList *selection)
{
- return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->special_link_in_selection (view, selection);
-}
+ gboolean saw_link;
+ GList *node;
+ NautilusFile *file;
-static gboolean
-real_special_link_in_selection (NautilusFilesView *view,
- GList *selection)
-{
- /* Normal views doesn't have any special link */
- return FALSE;
+ saw_link = FALSE;
+
+ for (node = selection; node != NULL; node = node->next) {
+ file = NAUTILUS_FILE (node->data);
+
+ saw_link = nautilus_file_is_special_link (file);
+
+ if (saw_link) {
+ break;
+ }
+ }
+
+ return saw_link;
}
/* desktop_or_home_dir_in_selection
@@ -7971,7 +7979,6 @@ nautilus_files_view_class_init (NautilusFilesViewClass *klass)
klass->update_context_menus = real_update_context_menus;
klass->update_actions_state = real_update_actions_state;
klass->check_empty_states = real_check_empty_states;
- klass->special_link_in_selection = real_special_link_in_selection;
klass->get_file_paths_or_uris_as_newline_delimited_string = real_get_file_paths_or_uris_as_newline_delimited_string;
copied_files_atom = gdk_atom_intern ("x-special/gnome-copied-files", FALSE);
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index 38b825e58..f775ab0a7 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -263,11 +263,6 @@ struct NautilusFilesViewClass {
* By default it shows a widget overlay on top of the view */
void (* check_empty_states) (NautilusFilesView *view);
- /* Use this to tell the view whether inside the selection there is some link
- * that cannot be worked with. This is used by the desktop for the trash,
- * home and other special links. */
- gboolean (* special_link_in_selection) (NautilusFilesView *view,
- GList *selection);
/* Use this when the scripts environment vars are being set, for selected files, etc.,
* if the subclassed view has some special links that need conversion to
* normal uris */