cleaning up nautilus



these patches remove some of the support for the old properties dialog
and nautilus themes (installing/removing user themes).

there is also a eel_bonobo_pbclient_set_value_async to
bonobo_pbclient_set_value_async that was moved down from eel to bonobo
in the last version.

eel patches follow.

There are some files that should be removed.

Diego

PD: if the patches are accepted i will write a Chagelog entry for them.
¿is there any interes in removing more stuff from eel? some time ago
some gnome-vfs from eel code was moved to gnome-vfs itself, but the eel
functions are still there and i think that nautilus is using the eel_*
stuff instead of gnome_vfs_* equivalents.


Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/src/Makefile.am,v
retrieving revision 1.144
diff -u -r1.144 Makefile.am
--- Makefile.am	31 Oct 2002 22:25:47 -0000	1.144
+++ Makefile.am	3 Nov 2002 16:04:54 -0000
@@ -69,7 +69,6 @@
 	nautilus-location-bar.c         	\
 	nautilus-main.c 			\
 	nautilus-navigation-bar.c         	\
-	nautilus-preferences-dialog.c		\
 	nautilus-profiler.c			\
 	nautilus-property-browser.c     	\
 	nautilus-search-bar-criterion.c		\
@@ -82,7 +81,6 @@
 	nautilus-simple-search-bar.c		\
 	nautilus-switchable-navigation-bar.c	\
 	nautilus-switchable-search-bar.c	\
-	nautilus-theme-selector.c		\
 	nautilus-view-frame-corba.c		\
 	nautilus-view-frame.c			\
 	nautilus-window-manage-views.c		\
@@ -103,7 +101,6 @@
 	nautilus-location-bar.h			\
 	nautilus-main.h				\
 	nautilus-navigation-bar.h		\
-	nautilus-preferences-dialog.h		\
 	nautilus-profiler.h			\
 	nautilus-property-browser.h		\
 	nautilus-search-bar-criterion-private.h	\
@@ -118,7 +115,6 @@
 	nautilus-simple-search-bar.h		\
 	nautilus-switchable-navigation-bar.h	\
 	nautilus-switchable-search-bar.h	\
-	nautilus-theme-selector.h		\
 	nautilus-view-frame-private.h		\
 	nautilus-view-frame.h			\
 	nautilus-window-manage-views.h		\
Index: nautilus-window-menus.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-menus.c,v
retrieving revision 1.252
diff -u -r1.252 nautilus-window-menus.c
--- nautilus-window-menus.c	31 Oct 2002 19:24:31 -0000	1.252
+++ nautilus-window-menus.c	3 Nov 2002 16:04:54 -0000
@@ -34,7 +34,6 @@
 #include "nautilus-bookmark-parsing.h"
 #include "nautilus-bookmarks-window.h"
 #include "nautilus-file-management-properties.h"
-#include "nautilus-preferences-dialog.h"
 #include "nautilus-property-browser.h"
 #include "nautilus-signaller.h"
 #include "nautilus-switchable-navigation-bar.h"
Index: nautilus-theme.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-theme.c,v
retrieving revision 1.47
diff -u -r1.47 nautilus-theme.c
--- nautilus-theme.c	10 Oct 2002 14:39:55 -0000	1.47
+++ nautilus-theme.c	3 Nov 2002 16:47:11 -0000
@@ -605,36 +605,6 @@
 }
 
 static void
-theme_list_invoke_callback (GList *theme_list,
-			    NautilusThemeCallback callback,
-			    gpointer callback_data)
-{
-	GList *node;
-	const ThemeAttibutes *attributes;
-
-	g_return_if_fail (callback != NULL);
-
-	for (node = theme_list; node != NULL; node = node->next) {
-		g_assert (node->data != NULL);
-		attributes = node->data;
-
-		g_assert (attributes->name != NULL);
-		g_assert (attributes->path != NULL);
-		g_assert (attributes->display_name != NULL);
-		g_assert (attributes->description != NULL);
-		g_assert (attributes->preview_pixbuf != NULL);
-
-		(* callback) (attributes->name,
-			      attributes->path,
-			      attributes->display_name,
-			      attributes->description,
-			      attributes->preview_pixbuf,
-			      attributes->builtin,
-			      callback_data);
-	}
-}
-
-static void
 attributes_free (gpointer data,
 		 gpointer user_data)
 {
@@ -655,25 +625,6 @@
 	g_free (attributes);
 }
 
-void
-nautilus_theme_for_each_theme (NautilusThemeCallback callback,
-			       gpointer callback_data)
-{
-	GList *builtin_themes;
-	GList *user_themes;
-
-	g_return_if_fail (callback != NULL);
-
-	builtin_themes = theme_get_builtin_themes ();
- 	user_themes = theme_get_user_themes ();
-
-	theme_list_invoke_callback (builtin_themes, callback, callback_data);
-	theme_list_invoke_callback (user_themes, callback, callback_data);
-
-	eel_g_list_free_deep_custom (builtin_themes, attributes_free, NULL);
-	eel_g_list_free_deep_custom (user_themes, attributes_free, NULL);
-}
-
 char *
 nautilus_theme_get_user_themes_directory (void)
 {
@@ -685,148 +636,4 @@
 	g_free (user_directory);
 
 	return user_themes_directory;
-}
-
-/* Remove the given theme name from from Nautilus. */
-GnomeVFSResult
-nautilus_theme_remove_user_theme (const char *theme_to_remove_name)
-{
-	char *user_themes_directory;
-	char *theme_to_remove_path;
-	GnomeVFSResult result;
-	GList *uri_list;
-
-	g_return_val_if_fail (theme_to_remove_name != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
-
-	user_themes_directory = nautilus_theme_get_user_themes_directory ();
-	theme_to_remove_path = g_build_filename (user_themes_directory, theme_to_remove_name, NULL);
-	g_free (user_themes_directory);
-	
-	uri_list = g_list_prepend (NULL, gnome_vfs_uri_new (theme_to_remove_path));			
-	g_free (theme_to_remove_path);
-
-	result = gnome_vfs_xfer_delete_list (uri_list, GNOME_VFS_XFER_RECURSIVE,
-					     GNOME_VFS_XFER_ERROR_MODE_ABORT,
-					     NULL, NULL);
-	gnome_vfs_uri_list_free (uri_list);
-
-	return result;
-}
-
-/* Install the theme found at the given path (if valid). */
-NautilusThemeInstallResult
-nautilus_theme_install_user_theme (const char *theme_to_install_path)
-{
-	GnomeVFSHandle *handle;
-	GnomeVFSResult result;
-	char *theme_name;
-	char *theme_xml_path;
-	char *user_themes_directory;
-	char *theme_destination_path;
-	char *command;
-	char *mime_type;
-	char *quoted_user_path;
-	char *quoted_theme_path;
-	int status;
-
-	user_themes_directory = nautilus_theme_get_user_themes_directory ();
-	
-	/* Create the user themes directory if it doesn't exist */
-	if (!g_file_test (user_themes_directory, G_FILE_TEST_EXISTS)) {
-		result = gnome_vfs_make_directory (user_themes_directory,
-						   GNOME_VFS_PERM_USER_ALL
-						   | GNOME_VFS_PERM_GROUP_ALL
-						   | GNOME_VFS_PERM_OTHER_READ);
-
-		if (result != GNOME_VFS_OK) {
-			g_free (user_themes_directory);
-			return NAUTILUS_THEME_INSTALL_FAILED_USER_THEMES_DIRECTORY_CREATION;
-		}
-	}
-
-	if (theme_to_install_path != NULL && g_file_test (theme_to_install_path, G_FILE_TEST_IS_REGULAR)) {
-		result = gnome_vfs_open (&handle, theme_to_install_path, GNOME_VFS_OPEN_READ);
-		gnome_vfs_close (handle);
-		/* Did we manage to read the file? */
-		if (result != GNOME_VFS_OK) {
-			g_free (user_themes_directory);
-			return NAUTILUS_THEME_INSTALL_FAILED;
-		}
-		mime_type = gnome_vfs_get_mime_type (theme_to_install_path);
-		if (mime_type != NULL) {
-			quoted_theme_path = g_shell_quote (theme_to_install_path);
-			quoted_user_path = g_shell_quote (user_themes_directory);
-			
-			if (strcmp (mime_type, "application/x-compressed-tar") == 0) {
-				/* gzipped tarball */
-				command = g_strdup_printf ("gzip -d -c < %s | (cd %s ; tar -xf -)", 
-							   quoted_theme_path,
-							   quoted_user_path
-							   );
-			} else if (strcmp (mime_type, "application/x-tar") == 0) {
-				/* vanilla tarball */
-				command = g_strdup_printf ("cd %s && tar -xf %s", 
-							   quoted_user_path, 
-							   quoted_theme_path
-							   );
-					   
-			} else if (strcmp (mime_type, "application/x-bzip") == 0) {
-				/* bzipped tarball */
-				command = g_strdup_printf ("bzip2 -d -c < %s | (cd %s ; tar -xf -)", 
-							   quoted_theme_path, 
-							   quoted_user_path
-							   );
-			} else {
-				/* unsupported mime-type */
-				command = NULL;
-			}
-			g_free (user_themes_directory);
-			g_free (quoted_theme_path);
-			g_free (quoted_user_path);
-			g_free (mime_type);
-			if (command != NULL) {
-				status = system (command);
-				g_free (command);
-				if (status != 0) {
-					return NAUTILUS_THEME_INSTALL_FAILED;
-				} else {
-					return NAUTILUS_THEME_INSTALL_OK; 
-				}
-			} else {
-				return NAUTILUS_THEME_INSTALL_NOT_A_THEME_FILE;
-			}
-		} else {
-			g_free (user_themes_directory);
-			return NAUTILUS_THEME_INSTALL_FAILED;
-		}
-	}
-
-	if (theme_to_install_path == NULL
-	    || !g_file_test (theme_to_install_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
-		return NAUTILUS_THEME_INSTALL_NOT_A_THEME_DIRECTORY;
-	}
-	
-	theme_name = eel_uri_get_basename (theme_to_install_path);
-	g_return_val_if_fail (theme_name != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
-	theme_destination_path = g_build_filename (user_themes_directory, theme_name, NULL);
-	theme_xml_path = g_strdup_printf ("%s/%s.xml",
-					  theme_to_install_path,
-					  theme_name);
-	g_free (user_themes_directory);
-	g_free (theme_name);
-	if (!g_file_test (theme_xml_path, G_FILE_TEST_EXISTS)) {
-		g_free (theme_destination_path);
-		g_free (theme_xml_path);
-		return NAUTILUS_THEME_INSTALL_NOT_A_THEME_DIRECTORY;
-	}
-	g_free (theme_xml_path);
-	result = eel_copy_uri_simple (theme_to_install_path, theme_destination_path);
-	if (result != GNOME_VFS_OK) {
-		g_free (theme_destination_path);
-		return NAUTILUS_THEME_INSTALL_FAILED;
-	}
-
-	g_free (theme_destination_path);
-	
-	return NAUTILUS_THEME_INSTALL_OK;
 }
Index: nautilus-theme.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-theme.h,v
retrieving revision 1.8
diff -u -r1.8 nautilus-theme.h
--- nautilus-theme.h	26 Apr 2002 19:07:11 -0000	1.8
+++ nautilus-theme.h	3 Nov 2002 16:47:11 -0000
@@ -85,14 +85,4 @@
 /* Return the directory where user themes are stored */
 char                      *nautilus_theme_get_user_themes_directory (void);
 
-/* Invoke the given callback for each theme available to Nautilus */
-void                       nautilus_theme_for_each_theme            (NautilusThemeCallback  callback,
-								     gpointer               callback_data);
-
-/* Remove a user theme from Nautilus. */
-GnomeVFSResult             nautilus_theme_remove_user_theme         (const char            *theme_to_remove_name);
-
-/* Install the theme found at the given path (if valid). */
-NautilusThemeInstallResult nautilus_theme_install_user_theme        (const char            *theme_to_install_path);
-
 #endif /* NAUTILUS_THEME_H */
Index: nautilus-window-toolbars.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-toolbars.c,v
retrieving revision 1.104
diff -u -r1.104 nautilus-window-toolbars.c
--- nautilus-window-toolbars.c	24 May 2002 21:54:04 -0000	1.104
+++ nautilus-window-toolbars.c	3 Nov 2002 16:48:16 -0000
@@ -341,7 +341,7 @@
 	val._value = &b;
 	b = throbbing;
 
-	eel_bonobo_pbclient_set_value_async (
+	bonobo_pbclient_set_value_async (
 		window->details->throbber_property_bag,
 		"throbbing", &val, NULL);
 }

Attachment: signature.asc
Description: This is a digitally signed message part



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