summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2002-02-07 00:24:43 +0000
committerDarin Adler <darin@src.gnome.org>2002-02-07 00:24:43 +0000
commite91afc85898f6530cd5dfb0d75e0296153b1588c (patch)
treefd22b55d1b78057d530dbf4e90a8d384a7eabb58 /src
parent4285ceae415ae8a454bbb6a8624b4be8c6e3906d (diff)
downloadnautilus-e91afc85898f6530cd5dfb0d75e0296153b1588c.tar.gz
eel_signal_connect_while_alive -> g_object_add_weak_pointer.
* components/throbber/nautilus-throbber.c: (nautilus_throbber_instance_init): eel_signal_connect_while_alive -> g_object_add_weak_pointer. (nautilus_throbber_finalize), (nautilus_throbber_class_init): Switch to finalize instead of destroy. * components/tree/nautilus-tree-expansion-state.c: Remove. * components/tree/nautilus-tree-expansion-state.h: Remove. * components/tree/nautilus-tree-node-private.h: Remove. * components/tree/nautilus-tree-node.c: Remove. * components/tree/nautilus-tree-node.h: Remove. * components/tree/nautilus-tree-model.h: * components/tree/nautilus-tree-model.c: Rewrite, based on Anders's first cut. * components/tree/nautilus-tree-view.h: Tweaks. * components/tree/nautilus-tree-view.c: (create_tree): Get rid of the header. (nautilus_tree_view_finalize), (nautilus_tree_view_class_init): Added a missing finalize so that we don't leak. * libnautilus-private/nautilus-directory.h: * libnautilus-private/nautilus-directory.c: (nautilus_directory_get_for_file): New. * libnautilus-private/nautilus-file.h: * libnautilus-private/nautilus-file.c: (finalize): Change to finalize from destroy. (nautilus_file_get_parent): Make public, simplify implementation by using nautilus_directory_get_corresponding_file. * src/file-manager/fm-desktop-icon-view.c: (fm_desktop_icon_view_init): * src/nautilus-sidebar.c: (nautilus_sidebar_update_buttons): * src/nautilus-view-frame.c: (nautilus_view_frame_init), (attach_view): * src/nautilus-window-menus.c: (nautilus_window_initialize_bookmarks_menu), (nautilus_window_initialize_go_menu): Use g_signal_connect-object instead of eel_signal_connect_while_alive.
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-desktop-icon-view.c44
-rw-r--r--src/nautilus-information-panel.c11
-rw-r--r--src/nautilus-navigation-window-menus.c25
-rw-r--r--src/nautilus-sidebar.c11
-rw-r--r--src/nautilus-view-frame.c61
-rw-r--r--src/nautilus-window-menus.c25
6 files changed, 54 insertions, 123 deletions
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 0693f5dd6..868e7f27c 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -33,7 +33,6 @@
#include <dirent.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-stock-dialogs.h>
@@ -609,38 +608,23 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
create_one_mount_link,
desktop_icon_view);
- g_signal_connect (icon_container,
- "middle_click",
- G_CALLBACK (fm_desktop_icon_view_handle_middle_click),
- desktop_icon_view);
+ g_signal_connect (icon_container, "middle_click",
+ G_CALLBACK (fm_desktop_icon_view_handle_middle_click), desktop_icon_view);
- g_signal_connect (icon_container,
- "compare_icons",
- G_CALLBACK (desktop_icons_compare_callback),
- desktop_icon_view);
-
- g_signal_connect (desktop_icon_view,
- "event",
- G_CALLBACK (event_callback),
- desktop_icon_view);
-
- eel_signal_connect_while_alive (G_OBJECT (nautilus_trash_monitor_get ()),
- "trash_state_changed",
- G_CALLBACK (fm_desktop_icon_view_trash_state_changed_callback),
- desktop_icon_view,
- G_OBJECT (desktop_icon_view));
+ g_signal_connect (icon_container, "compare_icons",
+ G_CALLBACK (desktop_icons_compare_callback), desktop_icon_view);
+
+ g_signal_connect (desktop_icon_view, "event",
+ G_CALLBACK (event_callback), desktop_icon_view);
+
+ g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
+ G_CALLBACK (fm_desktop_icon_view_trash_state_changed_callback), desktop_icon_view, 0);
- eel_signal_connect_while_alive (G_OBJECT (nautilus_volume_monitor_get ()),
- "volume_mounted",
- G_CALLBACK (volume_mounted_callback),
- desktop_icon_view,
- G_OBJECT (desktop_icon_view));
+ g_signal_connect_object (nautilus_volume_monitor_get (), "volume_mounted",
+ G_CALLBACK (volume_mounted_callback), desktop_icon_view, 0);
- eel_signal_connect_while_alive (G_OBJECT (nautilus_volume_monitor_get ()),
- "volume_unmounted",
- G_CALLBACK (volume_unmounted_callback),
- desktop_icon_view,
- G_OBJECT (desktop_icon_view));
+ g_signal_connect_object (nautilus_volume_monitor_get (), "volume_unmounted",
+ G_CALLBACK (volume_unmounted_callback), desktop_icon_view, 0);
eel_preferences_add_callback (NAUTILUS_PREFERENCES_HOME_URI,
home_uri_changed,
diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c
index 61c458c03..f58cf97eb 100644
--- a/src/nautilus-information-panel.c
+++ b/src/nautilus-information-panel.c
@@ -39,7 +39,6 @@
#include <eel/eel-background.h>
#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-stock-dialogs.h>
@@ -1516,14 +1515,10 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar)
sidebar->details->has_buttons = TRUE;
g_signal_connect (temp_button, "clicked",
- G_CALLBACK (empty_trash_callback), NULL);
+ G_CALLBACK (empty_trash_callback), NULL);
- eel_signal_connect_while_alive (G_OBJECT (nautilus_trash_monitor_get ()),
- "trash_state_changed",
- G_CALLBACK (nautilus_sidebar_trash_state_changed_callback),
- temp_button,
- G_OBJECT (temp_button));
-
+ g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
+ G_CALLBACK (nautilus_sidebar_trash_state_changed_callback), temp_button, 0);
}
/* Make buttons for each item in short list + "Open with..." catchall,
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index fad731855..c0705a9fb 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -44,7 +44,6 @@
#include <eel/eel-debug.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@@ -1070,16 +1069,12 @@ nautilus_window_initialize_bookmarks_menu (NautilusWindow *window)
G_OBJECT (window));
/* Recreate dynamic part of menu if bookmark list changes */
- gtk_signal_connect_object_while_alive (GTK_OBJECT (get_bookmark_list ()),
- "contents_changed",
- G_CALLBACK (schedule_refresh_bookmarks_menu),
- GTK_OBJECT (window));
+ g_signal_connect_object (get_bookmark_list (), "contents_changed",
+ G_CALLBACK (schedule_refresh_bookmarks_menu), window, G_CONNECT_SWAPPED);
/* Recreate static & dynamic parts of menu if icon theme changes */
- gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (),
- "icons_changed",
- G_CALLBACK (schedule_refresh_bookmarks_menu),
- GTK_OBJECT (window));
+ g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
+ G_CALLBACK (schedule_refresh_bookmarks_menu), window, G_CONNECT_SWAPPED);
}
/**
@@ -1093,14 +1088,10 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
/* Recreate bookmarks part of menu if history list changes
* or if icon theme changes.
*/
- eel_signal_connect_object_while_alive (nautilus_signaller_get_current (),
- "history_list_changed",
- G_CALLBACK (schedule_refresh_go_menu),
- G_OBJECT (window));
- eel_signal_connect_object_while_alive (G_OBJECT (nautilus_icon_factory_get ()),
- "icons_changed",
- G_CALLBACK (schedule_refresh_go_menu),
- G_OBJECT (window));
+ g_signal_connect_object (nautilus_signaller_get_current (), "history_list_changed",
+ G_CALLBACK (schedule_refresh_go_menu), window, G_CONNECT_SWAPPED);
+ g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
+ G_CALLBACK (schedule_refresh_go_menu), window, G_CONNECT_SWAPPED);
}
/**
diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c
index 61c458c03..f58cf97eb 100644
--- a/src/nautilus-sidebar.c
+++ b/src/nautilus-sidebar.c
@@ -39,7 +39,6 @@
#include <eel/eel-background.h>
#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-stock-dialogs.h>
@@ -1516,14 +1515,10 @@ nautilus_sidebar_update_buttons (NautilusSidebar *sidebar)
sidebar->details->has_buttons = TRUE;
g_signal_connect (temp_button, "clicked",
- G_CALLBACK (empty_trash_callback), NULL);
+ G_CALLBACK (empty_trash_callback), NULL);
- eel_signal_connect_while_alive (G_OBJECT (nautilus_trash_monitor_get ()),
- "trash_state_changed",
- G_CALLBACK (nautilus_sidebar_trash_state_changed_callback),
- temp_button,
- G_OBJECT (temp_button));
-
+ g_signal_connect_object (nautilus_trash_monitor_get (), "trash_state_changed",
+ G_CALLBACK (nautilus_sidebar_trash_state_changed_callback), temp_button, 0);
}
/* Make buttons for each item in short list + "Open with..." catchall,
diff --git a/src/nautilus-view-frame.c b/src/nautilus-view-frame.c
index d6fd63d25..16e2d3c67 100644
--- a/src/nautilus-view-frame.c
+++ b/src/nautilus-view-frame.c
@@ -39,7 +39,6 @@
#include <bonobo/bonobo-control-frame.h>
#include <bonobo/bonobo-zoomable-frame.h>
#include <bonobo/bonobo-zoomable.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-marshal.h>
@@ -152,14 +151,10 @@ nautilus_view_frame_init (NautilusViewFrame *view)
view->details->idle_queue = nautilus_idle_queue_new ();
- eel_signal_connect_object_while_alive (G_OBJECT (nautilus_signaller_get_current ()),
- "history_list_changed",
- G_CALLBACK (send_history),
- G_OBJECT (view));
- eel_signal_connect_object_while_alive (G_OBJECT (nautilus_icon_factory_get ()),
- "icons_changed",
- G_CALLBACK (send_history),
- G_OBJECT (view));
+ g_signal_connect_object (nautilus_signaller_get_current (), "history_list_changed",
+ G_CALLBACK (send_history), view, G_CONNECT_SWAPPED);
+ g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
+ G_CALLBACK (send_history), view, G_CONNECT_SWAPPED);
}
static void
@@ -733,42 +728,22 @@ attach_view (NautilusViewFrame *view,
widget = bonobo_control_frame_get_widget (view->details->control_frame);
- eel_signal_connect_object_while_alive
- (G_OBJECT (view->details->view_frame),
- "destroy",
- G_CALLBACK (view_frame_failed), G_OBJECT (view));
- eel_signal_connect_object_while_alive
- (G_OBJECT (view->details->view_frame),
- "system_exception",
- G_CALLBACK (queue_view_frame_failed), G_OBJECT (view));
-
- eel_signal_connect_object_while_alive
- (G_OBJECT (view->details->control_frame),
- "system_exception",
- G_CALLBACK (queue_view_frame_failed), G_OBJECT (view));
-
- eel_signal_connect_while_alive
- (G_OBJECT (widget),
- "remove",
- G_CALLBACK (check_socket_gone_callback), view,
- G_OBJECT (view));
+ g_signal_connect_object (view->details->view_frame, "destroy",
+ G_CALLBACK (view_frame_failed), view, G_CONNECT_SWAPPED);
+ g_signal_connect_object (view->details->view_frame, "system_exception",
+ G_CALLBACK (queue_view_frame_failed), view, G_CONNECT_SWAPPED);
+ g_signal_connect_object (view->details->control_frame, "system_exception",
+ G_CALLBACK (queue_view_frame_failed), view, G_CONNECT_SWAPPED);
+ g_signal_connect_object (widget, "remove",
+ G_CALLBACK (check_socket_gone_callback), view, 0);
if (view->details->zoomable_frame != NULL) {
- eel_signal_connect_object_while_alive
- (G_OBJECT (view->details->zoomable_frame),
- "system_exception",
- G_CALLBACK (queue_view_frame_failed), G_OBJECT (view));
-
- eel_signal_connect_while_alive
- (G_OBJECT (view->details->zoomable_frame),
- "zoom_parameters_changed",
- G_CALLBACK (zoom_parameters_changed_callback), view,
- G_OBJECT (view));
- eel_signal_connect_while_alive
- (G_OBJECT (view->details->zoomable_frame),
- "zoom_level_changed",
- G_CALLBACK (zoom_level_changed_callback), view,
- G_OBJECT (view));
+ g_signal_connect_object (view->details->zoomable_frame, "system_exception",
+ G_CALLBACK (queue_view_frame_failed), view, G_CONNECT_SWAPPED);
+ g_signal_connect_object (view->details->zoomable_frame, "zoom_parameters_changed",
+ G_CALLBACK (zoom_parameters_changed_callback), view, 0);
+ g_signal_connect_object (view->details->zoomable_frame, "zoom_level_changed",
+ G_CALLBACK (zoom_level_changed_callback), view, 0);
}
gtk_widget_show (widget);
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index fad731855..c0705a9fb 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -44,7 +44,6 @@
#include <eel/eel-debug.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gobject-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@@ -1070,16 +1069,12 @@ nautilus_window_initialize_bookmarks_menu (NautilusWindow *window)
G_OBJECT (window));
/* Recreate dynamic part of menu if bookmark list changes */
- gtk_signal_connect_object_while_alive (GTK_OBJECT (get_bookmark_list ()),
- "contents_changed",
- G_CALLBACK (schedule_refresh_bookmarks_menu),
- GTK_OBJECT (window));
+ g_signal_connect_object (get_bookmark_list (), "contents_changed",
+ G_CALLBACK (schedule_refresh_bookmarks_menu), window, G_CONNECT_SWAPPED);
/* Recreate static & dynamic parts of menu if icon theme changes */
- gtk_signal_connect_object_while_alive (nautilus_icon_factory_get (),
- "icons_changed",
- G_CALLBACK (schedule_refresh_bookmarks_menu),
- GTK_OBJECT (window));
+ g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
+ G_CALLBACK (schedule_refresh_bookmarks_menu), window, G_CONNECT_SWAPPED);
}
/**
@@ -1093,14 +1088,10 @@ nautilus_window_initialize_go_menu (NautilusWindow *window)
/* Recreate bookmarks part of menu if history list changes
* or if icon theme changes.
*/
- eel_signal_connect_object_while_alive (nautilus_signaller_get_current (),
- "history_list_changed",
- G_CALLBACK (schedule_refresh_go_menu),
- G_OBJECT (window));
- eel_signal_connect_object_while_alive (G_OBJECT (nautilus_icon_factory_get ()),
- "icons_changed",
- G_CALLBACK (schedule_refresh_go_menu),
- G_OBJECT (window));
+ g_signal_connect_object (nautilus_signaller_get_current (), "history_list_changed",
+ G_CALLBACK (schedule_refresh_go_menu), window, G_CONNECT_SWAPPED);
+ g_signal_connect_object (nautilus_icon_factory_get (), "icons_changed",
+ G_CALLBACK (schedule_refresh_go_menu), window, G_CONNECT_SWAPPED);
}
/**