[nautilus/refactor] view: don't check for allow_moves in the view superclass
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/refactor] view: don't check for allow_moves in the view superclass
- Date: Fri, 31 Dec 2010 16:31:40 +0000 (UTC)
commit 0f87aa192b74711f33a64a73afd98163b3def6f3
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Dec 31 17:30:03 2010 +0100
view: don't check for allow_moves in the view superclass
The property is only used by the icon view, so it's better to move the
check there.
src/file-manager/fm-icon-view.c | 7 +++++--
src/nautilus-view.c | 18 ------------------
src/nautilus-view.h | 1 -
3 files changed, 5 insertions(+), 21 deletions(-)
---
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index 6f4e0fb..2fdba6e 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -1200,18 +1200,21 @@ fm_icon_view_begin_loading (FMDirectoryView *view)
GtkWidget *icon_container;
NautilusFile *file;
int level;
- char *sort_name;
+ char *sort_name, *uri;
g_return_if_fail (FM_IS_ICON_VIEW (view));
icon_view = FM_ICON_VIEW (view);
file = fm_directory_view_get_directory_as_file (view);
+ uri = nautilus_file_get_uri (file);
icon_container = GTK_WIDGET (get_icon_container (icon_view));
nautilus_icon_container_begin_loading (NAUTILUS_ICON_CONTAINER (icon_container));
nautilus_icon_container_set_allow_moves (NAUTILUS_ICON_CONTAINER (icon_container),
- fm_directory_view_get_allow_moves (view));
+ !eel_uri_is_search (uri));
+
+ g_free (uri);
/* kill any sound preview process that is ongoing */
preview_audio (icon_view, NULL, FALSE);
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 67e5845..481b5dc 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -252,8 +252,6 @@ struct FMDirectoryViewDetails
GList *subdirectory_list;
- gboolean allow_moves;
-
GdkPoint context_menu_position;
};
@@ -2994,30 +2992,14 @@ fm_directory_view_send_selection_change (FMDirectoryView *view)
view->details->send_selection_change_to_shell = FALSE;
}
-gboolean
-fm_directory_view_get_allow_moves (FMDirectoryView *view)
-{
- return view->details->allow_moves;
-}
-
void
nautilus_view_load_location (NautilusView *nautilus_view,
GFile *location)
{
NautilusDirectory *directory;
FMDirectoryView *directory_view;
- gchar *uri;
directory_view = FM_DIRECTORY_VIEW (nautilus_view);
- uri = g_file_get_uri (location);
-
- if (eel_uri_is_search (uri)) {
- directory_view->details->allow_moves = FALSE;
- } else {
- directory_view->details->allow_moves = TRUE;
- }
-
- g_free (uri);
directory = nautilus_directory_get (location);
load_directory (directory_view, directory);
diff --git a/src/nautilus-view.h b/src/nautilus-view.h
index d155c51..610c853 100644
--- a/src/nautilus-view.h
+++ b/src/nautilus-view.h
@@ -377,7 +377,6 @@ GtkUIManager * fm_directory_view_get_ui_manager (FMDirect
char ** fm_directory_view_get_emblem_names_to_exclude (FMDirectoryView *view);
NautilusDirectory *fm_directory_view_get_model (FMDirectoryView *view);
NautilusFile *fm_directory_view_get_directory_as_file (FMDirectoryView *view);
-gboolean fm_directory_view_get_allow_moves (FMDirectoryView *view);
void fm_directory_view_pop_up_background_context_menu (FMDirectoryView *view,
GdkEventButton *event);
void fm_directory_view_pop_up_selection_context_menu (FMDirectoryView *view,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]