Commit a22e0be9 authored by Cosimo Cecchi's avatar Cosimo Cecchi

bookmarks-window: remove methods that deal with geometry

Since we don't actually save or load it from disk, these are useless.
parent d5a9299f
......@@ -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);
......
......@@ -45,7 +45,6 @@ enum {
};
static guint signals[LAST_SIGNAL];
static char *window_geometry;
static NautilusBookmarkList *singleton = NULL;
/* forward declarations */
......@@ -388,22 +387,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:
*
......@@ -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);
}
......@@ -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 */
......@@ -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);
......@@ -454,54 +455,6 @@ get_selection_exists (void)
return gtk_tree_selection_get_selected (bookmark_selection, NULL, NULL);
}
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)
{
......
......@@ -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 */
......@@ -116,21 +116,6 @@ get_or_create_bookmarks_window (NautilusWindow *window)
return bookmarks_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
*
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment