summaryrefslogtreecommitdiff
path: root/libnautilus
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-11-30 00:06:07 +0000
committerDarin Adler <darin@src.gnome.org>2000-11-30 00:06:07 +0000
commitfcb7d41216b32d39072eda0d47c17d5dccc482da (patch)
treec6a24aff617d7269eaa74c25d8e0ddb51fc80b01 /libnautilus
parentf85dc70aade07711cd3ed1f3034116661bb3ac77 (diff)
downloadnautilus-fcb7d41216b32d39072eda0d47c17d5dccc482da.tar.gz
reviewed by: Pavel Cisler <pavel@eazel.com>
Fixed some problems with callbacks that are left around after the object is destroyed. * src/nautilus-window-manage-views.h: * src/nautilus-window-manage-views.c: (viewed_file_changed_callback): Changed to be a normal callback, not a "connect_object" callback, and simplified the logic. (cancel_viewed_file_changed_callback): Added a function to cancel the callback, which is needed both when the window is destroyed and when the viewed file changes. (update_for_new_location): Cancel the old callback before setting up the new one so we don't leave behind callbacks for old locations. Also use the new nautilus_window_set_viewed_file function so the callbacks set up in nautilus-window.c can be managed properly. (free_location_change): Moved part of nautilus_window_free_load_info in here. This function frees all the stuff that's used in the location change process; shared by destroy and "cancel" code. Also fixed a bug where it wouldn't free the "error_views". (cancel_location_change): Moved the rest of nautilus_window_free_load_info in here and made this use the new function. (disconnect_view): Made this private now that the code to disconnect the views is inside this file. (disconnect_view_callback), (nautilus_window_manage_views_destroy): Moved the code to clean up from nautilus-window.c in here. Added cleanup for the location change fields and for the viewd_file_changed callback. * src/nautilus-window.c: (nautilus_window_destroy): Call a new function to do the nautilus-window-manage-views.c part of the destroy and moved some code in there. Cancel the view-as callback too. (create_view_as_menu_item), (replace_special_current_view_in_view_as_menu), (nautilus_window_synch_view_as_menu): Renamed. The words "view as menu" are clearer than "content view menu". (chose_component_callback): Got rid of code that tries to handle bad values for callback data. The callback must be cancelled, because you can't call NAUTILUS_IS_WINDOW on a freed window and expect it to behave predictably. (cancel_chose_component_callback): Function to cancel the callback, called at both destroy time and before adding a new one. (view_menu_choose_view_callback): Cancel the old callback before adding a new one. (view_menu_vfs_method_callback): Simplify logic a bit. (load_view_as_menu_callback): Renamed. (cancel_view_as_callback): Function to cancel the callback, called at both destroy time and before adding a new one. (nautilus_window_load_view_as_menu): Cancel the old callback before adding a new one. Also renamed. (nautilus_window_set_viewed_file): A new function that cancels the callbacks on the file object before switching to a new one. * libnautilus-extensions/nautilus-program-choosing.c: (nautilus_cancel_choose_component_for_file): Implemented missing cancel function, needed by new window code. * src/nautilus-window-private.h: * src/nautilus-window-menus.c: (bookmarks_menu_add_bookmark_callback), (add_bookmark_for_current_location): Made the function local to this file since it's both defined and used here. * libnautilus-extensions/nautilus-glib-extensions.c: * libnautilus-extensions/nautilus-volume-monitor.c: * libnautilus/nautilus-undo-transaction.c: * libnautilus/nautilus-view.c: * librsvg/rsvg.c: Added missing "static" to make some local non-"nautilus_"-prefixed globals be internal instead of external. * src/nautilus-sidebar.c: Formatting tweaks, added FIXME.
Diffstat (limited to 'libnautilus')
-rw-r--r--libnautilus/nautilus-undo-transaction.c2
-rw-r--r--libnautilus/nautilus-view.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libnautilus/nautilus-undo-transaction.c b/libnautilus/nautilus-undo-transaction.c
index 1402a4408..d9fb7229a 100644
--- a/libnautilus/nautilus-undo-transaction.c
+++ b/libnautilus/nautilus-undo-transaction.c
@@ -61,7 +61,7 @@ static void undo_atom_list_undo_and_free
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusUndoTransaction, nautilus_undo_transaction, BONOBO_OBJECT_TYPE)
-POA_Nautilus_Undo_Transaction__epv libnautilus_Nautilus_Undo_Transaction_epv =
+static POA_Nautilus_Undo_Transaction__epv libnautilus_Nautilus_Undo_Transaction_epv =
{
NULL,
&impl_Nautilus_Undo_Transaction__get_undo_menu_item,
diff --git a/libnautilus/nautilus-view.c b/libnautilus/nautilus-view.c
index 971495c84..dcf6fbf31 100644
--- a/libnautilus/nautilus-view.c
+++ b/libnautilus/nautilus-view.c
@@ -74,7 +74,7 @@ static void nautilus_view_initialize_class (NautilusViewClass *klass)
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusView, nautilus_view, BONOBO_OBJECT_TYPE)
-POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
+static POA_Nautilus_View__epv libnautilus_Nautilus_View_epv =
{
NULL,
&impl_Nautilus_View_load_location,