[nautilus] bookmarks-window: remove methods that deal with geometry



commit a22e0be9b5b66c57d317877d182258357177e8b2
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Apr 24 11:18:18 2012 -0400

    bookmarks-window: remove methods that deal with geometry
    
    Since we don't actually save or load it from disk, these are useless.

 src/nautilus-application.c      |    2 -
 src/nautilus-bookmark-list.c    |   40 -----------------------------
 src/nautilus-bookmark-list.h    |    3 --
 src/nautilus-bookmarks-window.c |   53 ++------------------------------------
 src/nautilus-bookmarks-window.h |    1 -
 src/nautilus-window-bookmarks.c |   15 -----------
 src/nautilus-window-bookmarks.h |    1 -
 7 files changed, 3 insertions(+), 112 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index f1d21a0..1513fdb 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -904,8 +904,6 @@ nautilus_application_finalize (GObject *object)
 
 	application = NAUTILUS_APPLICATION (object);
 
-	nautilus_bookmarks_exiting ();
-
 	g_clear_object (&application->priv->volume_monitor);
 	g_clear_object (&application->priv->progress_handler);
 
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index ac009e1..3d7d437 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -45,7 +45,6 @@ enum {
 };
 
 static guint signals[LAST_SIGNAL];
-static char *window_geometry;
 static NautilusBookmarkList *singleton = NULL;
 
 /* forward declarations */
@@ -389,22 +388,6 @@ nautilus_bookmark_list_delete_items_with_uri (NautilusBookmarkList *bookmarks,
 }
 
 /**
- * nautilus_bookmark_list_get_window_geometry:
- * 
- * Get a string representing the bookmark_list's window's geometry.
- * This is the value set earlier by nautilus_bookmark_list_set_window_geometry.
- * @bookmarks: the list of bookmarks associated with the window.
- * Return value: string representation of window's geometry, suitable for
- * passing to gnome_parse_geometry(), or NULL if
- * no window geometry has yet been saved for this bookmark list.
- **/
-const char *
-nautilus_bookmark_list_get_window_geometry (NautilusBookmarkList *bookmarks)
-{
-	return window_geometry;
-}
-
-/**
  * nautilus_bookmark_list_insert_item:
  * 
  * Insert a bookmark at a specified position.
@@ -693,26 +676,3 @@ nautilus_bookmark_list_new (void)
 
 	return list;
 }
-
-/**
- * nautilus_bookmark_list_set_window_geometry:
- * 
- * Set a bookmarks window's geometry (position & size), in string form. This is
- * stored to disk by this class, and can be retrieved later in
- * the same session or in a future session.
- * @bookmarks: the list of bookmarks associated with the window.
- * @geometry: the new window geometry string.
- **/
-void
-nautilus_bookmark_list_set_window_geometry (NautilusBookmarkList *bookmarks,
-					    const char           *geometry)
-{
-	g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
-	g_return_if_fail (geometry != NULL);
-
-	g_free (window_geometry);
-	window_geometry = g_strdup (geometry);
-
-	nautilus_bookmark_list_save_file (bookmarks);
-}
-
diff --git a/src/nautilus-bookmark-list.h b/src/nautilus-bookmark-list.h
index 4684b28..04cee8f 100644
--- a/src/nautilus-bookmark-list.h
+++ b/src/nautilus-bookmark-list.h
@@ -78,8 +78,5 @@ NautilusBookmark *      nautilus_bookmark_list_item_at             (NautilusBook
 void                    nautilus_bookmark_list_move_item           (NautilusBookmarkList *bookmarks,
 								    guint                 index,
 								    guint                 destination);
-void                    nautilus_bookmark_list_set_window_geometry (NautilusBookmarkList   *bookmarks,
-								    const char             *geometry);
-const char *            nautilus_bookmark_list_get_window_geometry (NautilusBookmarkList   *bookmarks);
 
 #endif /* NAUTILUS_BOOKMARK_LIST_H */
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index c6932ce..839af9a 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -69,7 +69,6 @@ static int                   jump_button_signal_id;
 static guint    get_selected_row                            (void);
 static gboolean get_selection_exists                        (void);
 static void     name_or_uri_field_activate                  (NautilusEntry        *entry);
-static void     nautilus_bookmarks_window_restore_geometry  (GtkWidget            *window);
 static void     on_bookmark_list_changed                    (NautilusBookmarkList *list,
 							     gpointer              user_data);
 static void     on_name_field_changed                       (GtkEditable          *editable,
@@ -267,7 +266,9 @@ create_bookmarks_window (NautilusBookmarkList *list, GObject *undo_manager_sourc
 	set_up_close_accelerator (window);
 
 	gtk_window_set_wmclass (GTK_WINDOW (window), "bookmarks", "Nautilus");
-	nautilus_bookmarks_window_restore_geometry (window);
+	gtk_window_set_default_size (GTK_WINDOW (window), 
+				     BOOKMARKS_WINDOW_INITIAL_WIDTH, 
+				     BOOKMARKS_WINDOW_INITIAL_HEIGHT);
 
 	g_object_weak_ref (G_OBJECT (undo_manager_source), edit_bookmarks_dialog_reset_signals, 
 			   undo_manager_source);
@@ -455,54 +456,6 @@ get_selection_exists (void)
 }
 
 static void
-nautilus_bookmarks_window_restore_geometry (GtkWidget *window)
-{
-	const char *window_geometry;
-	
-	g_return_if_fail (GTK_IS_WINDOW (window));
-	g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
-
-	window_geometry = nautilus_bookmark_list_get_window_geometry (bookmarks);
-
-	if (window_geometry != NULL) {	
-		eel_gtk_window_set_initial_geometry_from_string 
-			(GTK_WINDOW (window), window_geometry, 
-			 BOOKMARKS_WINDOW_MIN_WIDTH, BOOKMARKS_WINDOW_MIN_HEIGHT, FALSE);
-
-	} else {
-		/* use default since there was no stored geometry */
-		gtk_window_set_default_size (GTK_WINDOW (window), 
-					     BOOKMARKS_WINDOW_INITIAL_WIDTH, 
-					     BOOKMARKS_WINDOW_INITIAL_HEIGHT);
-
-		/* Let window manager handle default position if no position stored */
-	}
-}
-
-/**
- * nautilus_bookmarks_window_save_geometry:
- * 
- * Save window size & position to disk.
- * @window: The bookmarks window whose geometry should be saved.
- **/
-void
-nautilus_bookmarks_window_save_geometry (GtkWindow *window)
-{
-	g_return_if_fail (GTK_IS_WINDOW (window));
-	g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
-
-	/* Don't bother if window is already closed */
-	if (gtk_widget_get_visible (GTK_WIDGET (window))) {
-		char *geometry_string;
-		
-		geometry_string = eel_gtk_window_get_geometry_string (window);
-
-		nautilus_bookmark_list_set_window_geometry (bookmarks, geometry_string);
-		g_free (geometry_string);
-	}
-}
-
-static void
 on_bookmark_list_changed (NautilusBookmarkList *bookmarks, gpointer data)
 {
 	g_return_if_fail (NAUTILUS_IS_BOOKMARK_LIST (bookmarks));
diff --git a/src/nautilus-bookmarks-window.h b/src/nautilus-bookmarks-window.h
index f870300..03c5de6 100644
--- a/src/nautilus-bookmarks-window.h
+++ b/src/nautilus-bookmarks-window.h
@@ -33,7 +33,6 @@
 
 GtkWindow *create_bookmarks_window                 (NautilusBookmarkList *bookmarks,
 						    GObject              *undo_manager_source);
-void       nautilus_bookmarks_window_save_geometry (GtkWindow            *window);
 void	   edit_bookmarks_dialog_set_signals	   (GObject 		 *undo_manager_source);
 
 #endif /* NAUTILUS_BOOKMARKS_WINDOW_H */
diff --git a/src/nautilus-window-bookmarks.c b/src/nautilus-window-bookmarks.c
index 18b5e3a..ecfd49e 100644
--- a/src/nautilus-window-bookmarks.c
+++ b/src/nautilus-window-bookmarks.c
@@ -117,21 +117,6 @@ get_or_create_bookmarks_window (NautilusWindow *window)
 }
 
 /**
- * nautilus_bookmarks_exiting:
- * 
- * Last chance to save state before app exits.
- * Called when application exits; don't call from anywhere else.
- **/
-void
-nautilus_bookmarks_exiting (void)
-{
-	if (bookmarks_window != NULL) {
-		nautilus_bookmarks_window_save_geometry (bookmarks_window);
-		gtk_widget_destroy (GTK_WIDGET (bookmarks_window));
-	}
-}
-
-/**
  * add_bookmark_for_current_location
  * 
  * Add a bookmark for the displayed location to the bookmarks menu.
diff --git a/src/nautilus-window-bookmarks.h b/src/nautilus-window-bookmarks.h
index ba051c1..4fa2fc3 100644
--- a/src/nautilus-window-bookmarks.h
+++ b/src/nautilus-window-bookmarks.h
@@ -29,7 +29,6 @@
 #include <nautilus-window.h>
 #include "nautilus-bookmark-list.h"
 
-void                  nautilus_bookmarks_exiting                        (void);
 void                  nautilus_window_add_bookmark_for_current_location (NautilusWindow *window);
 void                  nautilus_window_edit_bookmarks                    (NautilusWindow *window);
 void                  nautilus_window_initialize_bookmarks_menu         (NautilusWindow *window);



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