[patch] fixup recent-files stuff a bit



Hi,

Here's a patch that makes it so we only create one EggRecentModel for
the entire app, instead of for every new window.

Thanks,
James


Index: libnautilus-private/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/Makefile.am,v
retrieving revision 1.224
diff -u -r1.224 Makefile.am
--- libnautilus-private/Makefile.am	4 Oct 2002 16:05:48 -0000	1.224
+++ libnautilus-private/Makefile.am	5 Nov 2002 00:31:23 -0000
@@ -35,7 +35,7 @@
 	nautilus-marshal-guts.c \
 	$(NULL)
 
-EGGFILES =			\
+EGG_SCREEN_FILES =			\
 	egg-screen-exec.h	\
 	egg-screen-exec.c	\
 	egg-screen-url.h	\
@@ -44,6 +44,15 @@
 	egg-screen-help.c	\
 	$(NULL)
 
+EGG_RECENT_FILES =		\
+	egg-recent-model.c	\
+	egg-recent-model.h	\
+	egg-recent-item.c	\
+	egg-recent-item.h       \
+	egg-recent-vfs-utils.c  \
+	egg-recent-vfs-utils.h	\
+	$(NULL)
+
 libnautilus_private_la_SOURCES = \
 	$(nautilus_metafile_server_idl_sources)	\
 	eggtreemultidnd.c \
@@ -141,6 +150,8 @@
 	nautilus-program-chooser.h \
 	nautilus-program-choosing.c \
 	nautilus-program-choosing.h \
+	nautilus-recent.h \
+	nautilus-recent.c \
 	nautilus-search-uri.c \
 	nautilus-search-uri.h \
 	nautilus-sidebar-functions.c \
@@ -173,7 +184,8 @@
 	nautilus-view-identifier.h \
 	nautilus-volume-monitor.c \
 	nautilus-volume-monitor.h \
-	$(EGGFILES) \
+	$(EGG_SCREEN_FILES) \
+	$(EGG_RECENT_FILES) \
 	$(NULL)
 
 fsattributesdir = $(datadir)/nautilus
@@ -222,7 +234,9 @@
 dist-hook:
 	cd $(distdir); rm -f $(CLEANFILES)
 
-EGGDIR = $(srcdir)/../../libegg/libegg/screen-exec
+EGG_SCREEN_DIR = $(srcdir)/../../libegg/libegg/screen-exec
+EGG_RECENT_DIR = $(srcdir)/../../libegg/libegg/recent-files
 
 regenerate-built-sources:
-	EGGFILES="$(EGGFILES)" EGGDIR="$(EGGDIR)" $(srcdir)/update-from-egg.sh
+	EGGFILES="$(EGG_SCREEN_FILES)" EGGDIR="$(EGG_SCREEN_DIR)" $(srcdir)/update-from-egg.sh
+	EGGFILES="$(EGG_RECENT_FILES)" EGGDIR="$(EGG_RECENT_DIR)" $(srcdir)/update-from-egg.sh
Index: src/file-manager/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/Makefile.am,v
retrieving revision 1.69
diff -u -r1.69 Makefile.am
--- src/file-manager/Makefile.am	10 Oct 2002 21:43:26 -0000	1.69
+++ src/file-manager/Makefile.am	5 Nov 2002 00:31:23 -0000
@@ -15,13 +15,7 @@
 	-DGNOME_DISABLE_DEPRECATED \
 	$(NULL)	
 
-EGG_RECENT_FILES =		\
-	egg-recent-model.c	\
-	egg-recent-model.h	\
-	egg-recent-item.c	\
-	egg-recent-item.h       \
-	egg-recent-vfs-utils.c  \
-	egg-recent-vfs-utils.h
+
 
 libnautilus_file_manager_la_SOURCES=	\
 	fm-desktop-icon-view.c		\
@@ -45,7 +39,6 @@
 	fm-properties-window.h 		\
 	fm-search-list-view.h 		\
 	nautilus-indexing-info.h 	\
-	$(EGG_RECENT_FILES)		\
 	$(NULL)
 
 uidir = $(datadir)/gnome-2.0/ui
@@ -57,8 +50,3 @@
 	$(NULL)
 
 EXTRA_DIST = $(ui_DATA)
-
-EGG_DIR = $(srcdir)/../../../libegg/libegg/recent-files
-
-regenerate-built-sources:
-	EGGFILES="$(EGG_RECENT_FILES)" EGGDIR="$(EGG_DIR)" $(srcdir)/update-from-egg.sh
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.554
diff -u -r1.554 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	11 Oct 2002 22:22:46 -0000	1.554
+++ src/file-manager/fm-directory-view.c	5 Nov 2002 00:31:25 -0000
@@ -30,7 +30,6 @@
 #include <config.h>
 #include "fm-directory-view.h"
 
-#include "egg-recent-model.h"
 #include "fm-desktop-icon-view.h"
 #include "fm-error-reporting.h"
 #include "fm-properties-window.h"
@@ -62,6 +61,7 @@
 #include <libgnomevfs/gnome-vfs-result.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
+#include <libnautilus-private/nautilus-recent.h>
 #include <libnautilus-private/egg-screen-exec.h>
 #include <libnautilus-private/nautilus-bonobo-extensions.h>
 #include <libnautilus-private/nautilus-directory-background.h>
@@ -237,8 +237,6 @@
 	gboolean send_selection_change_to_shell;
 
 	NautilusFile *file_monitored_for_open_with;
-
-	EggRecentModel *recent_model;
 };
 
 typedef enum {
@@ -585,7 +583,7 @@
 		(application, file, fm_directory_view_get_containing_window (directory_view));
 	
 	uri = nautilus_file_get_uri (file);
-	egg_recent_model_add (directory_view->details->recent_model, uri);
+	egg_recent_model_add (nautilus_recent_get_model (), uri);
 
 	g_free (uri);
 }				      
@@ -1358,9 +1356,6 @@
 	eel_preferences_add_callback (NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST, 
 				      sort_directories_first_changed_callback, view);
 
-	view->details->recent_model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_NONE);
-	/* we aren't interested at all in viewing the list */
-	egg_recent_model_set_limit (view->details->recent_model, 0);
 }
 
 static void
@@ -1371,11 +1366,6 @@
 	view = FM_DIRECTORY_VIEW (object);
 
 	disconnect_model_handlers (view);
-
-	if (view->details->recent_model) {
-		g_object_unref (view->details->recent_model);
-		view->details->recent_model = NULL;
-	}
 
 	/* Since we are owned by the NautilusView, if we're going it's
 	 * gone. It would be even better to NULL this out when the


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