Commit 136742e4 authored by Darin Adler's avatar Darin Adler Committed by Darin Adler

Because lots of recent bugs were due to "signal handler called after

	* Tons of files:
	Because lots of recent bugs were due to "signal handler called after
	object gone" problems, switched many calls of g_signal_connect and
	g_signal_connect_swapped to use g_signal_connect_object instead.
	Also did other signal-related cleanup and changed some destroys to
	finalizes.

	* libnautilus/nautilus-view-standard-main.h:
	We no longer need to include nautilus-view.h in here. So include it
	in the files that use this instead.

	Did merges from stable branch:

	2001-10-25  Darin Adler  <darin@bentspoon.com>

        * libnautilus-private/nautilus-directory.c:
        (call_files_changed_common), (call_files_changed_free_list),
        (call_files_changed_unref_free_list),
        (nautilus_directory_notify_files_changed): Move call to
        nautilus_directory_add_file_to_work_queue into a better
        bottleneck; now it catches all the notify cases, not just changed.
        Also tell it to re-get top-left text and link info too when we get
        a changed notice.

        * src/file-manager/fm-directory-view.c: (queue_pending_files):
        Don't use the timeout (and the hysteresis) when queuing files once
        the initial directory load is complete. Doing this was causing
        delays processing changes that came in later, which we don't want.

        * src/nautilus-sidebar-title.c: (item_count_ready), (monitor_add),
	(update_all), (nautilus_sidebar_title_set_file): Monitor the
	directory count once we get it the first time. This makes sure
	that changes in the directory count get reflected in the sidebar
	without creating a race with the main view to see who calculates
	it first.

	2001-10-25  Alex Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-directory.c
	(nautilus_directory_notify_files_changed): Call
	nautilus_directory_add_file_to_work_queue() when file_info is
	invalidated.  Otherwise it will not be read again.
parent 6b579803
2002-03-07 Darin Adler <darin@bentspoon.com>
* Tons of files:
Because lots of recent bugs were due to "signal handler called after
object gone" problems, switched many calls of g_signal_connect and
g_signal_connect_swapped to use g_signal_connect_object instead.
Also did other signal-related cleanup and changed some destroys to
finalizes.
* libnautilus/nautilus-view-standard-main.h:
We no longer need to include nautilus-view.h in here. So include it
in the files that use this instead.
Did merges from stable branch:
2001-10-25 Darin Adler <darin@bentspoon.com>
* libnautilus-private/nautilus-directory.c:
(call_files_changed_common), (call_files_changed_free_list),
(call_files_changed_unref_free_list),
(nautilus_directory_notify_files_changed): Move call to
nautilus_directory_add_file_to_work_queue into a better
bottleneck; now it catches all the notify cases, not just changed.
Also tell it to re-get top-left text and link info too when we get
a changed notice.
* src/file-manager/fm-directory-view.c: (queue_pending_files):
Don't use the timeout (and the hysteresis) when queuing files once
the initial directory load is complete. Doing this was causing
delays processing changes that came in later, which we don't want.
* src/nautilus-sidebar-title.c: (item_count_ready), (monitor_add),
(update_all), (nautilus_sidebar_title_set_file): Monitor the
directory count once we get it the first time. This makes sure
that changes in the directory count get reflected in the sidebar
without creating a race with the main view to see who calculates
it first.
2001-10-25 Alex Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-directory.c
(nautilus_directory_notify_files_changed): Call
nautilus_directory_add_file_to_work_queue() when file_info is
invalidated. Otherwise it will not be read again.
2002-03-07 Michael Meeks <michael@ximian.com>
* libnautilus-private/nautilus-horizontal-splitter.c
......
......@@ -164,8 +164,8 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
strategy->details->widget = bonobo_control_frame_get_widget (strategy->details->control_frame);
g_signal_connect (strategy->details->control_frame,
"activate_uri", G_CALLBACK (activate_uri_callback), strategy);
g_signal_connect_object (strategy->details->control_frame, "activate_uri",
G_CALLBACK (activate_uri_callback), strategy, 0);
CORBA_exception_init (&ev);
corba_zoomable = Bonobo_Unknown_queryInterface (control,
......
......@@ -168,11 +168,10 @@ nautilus_adapter_control_factory_embed_strategy_new (Bonobo_ControlFactory contr
if ((ev._major == CORBA_NO_EXCEPTION) &&
!CORBA_Object_is_nil (control, &ev)) {
Bonobo_Zoomable corba_zoomable;
strategy->details->client_widget = bonobo_control_frame_get_widget (
strategy->details->control_frame);
g_signal_connect (strategy->details->control_frame,
"activate_uri",
G_CALLBACK (activate_uri_callback), strategy);
strategy->details->client_widget = bonobo_control_frame_get_widget
(strategy->details->control_frame);
g_signal_connect_object (strategy->details->control_frame, "activate_uri",
G_CALLBACK (activate_uri_callback), strategy, 0);
gtk_widget_show (strategy->details->client_widget);
......
......@@ -46,10 +46,6 @@ struct NautilusAdapterDetails {
NautilusView *nautilus_view;
NautilusAdapterEmbedStrategy *embed_strategy;
NautilusAdapterLoadStrategy *load_strategy;
guint report_load_underway_id;
guint report_load_progress_id;
guint report_load_complete_id;
guint report_load_failed_id;
};
......@@ -104,15 +100,6 @@ nautilus_adapter_destroy (GtkObject *object)
adapter = NAUTILUS_ADAPTER (object);
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_underway_id);
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_progress_id);
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_complete_id);
g_signal_handler_disconnect (GTK_OBJECT (adapter->details->load_strategy),
adapter->details->report_load_failed_id);
if (adapter->details->embed_strategy != NULL) {
nautilus_adapter_embed_strategy_deactivate (adapter->details->embed_strategy);
}
......@@ -166,14 +153,10 @@ nautilus_adapter_new (Bonobo_Unknown component)
if (zoomable != NULL)
bonobo_object_add_interface (BONOBO_OBJECT (control), zoomable);
g_signal_connect (control, "activate",
G_CALLBACK (nautilus_adapter_activate_callback),
adapter);
g_signal_connect (adapter->details->embed_strategy, "open_location",
G_CALLBACK (nautilus_adapter_open_location_callback),
adapter);
g_signal_connect_object (control, "activate",
G_CALLBACK (nautilus_adapter_activate_callback), adapter, 0);
g_signal_connect_object (adapter->details->embed_strategy, "open_location",
G_CALLBACK (nautilus_adapter_open_location_callback), adapter, 0);
/* Get the class to handle loading this kind of component. */
adapter->details->load_strategy = nautilus_adapter_load_strategy_get (component);
......@@ -183,40 +166,28 @@ nautilus_adapter_new (Bonobo_Unknown component)
}
/* hook up load strategy signals */
adapter->details->report_load_underway_id =
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_underway",
G_CALLBACK (nautilus_adapter_load_underway_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_progress_id =
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_progress",
G_CALLBACK (nautilus_adapter_load_progress_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_complete_id =
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_complete",
G_CALLBACK (nautilus_adapter_load_complete_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_failed_id =
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_failed",
G_CALLBACK (nautilus_adapter_load_failed_callback),
GTK_OBJECT (adapter));
g_signal_connect_object (adapter->details->load_strategy, "report_load_underway",
G_CALLBACK (nautilus_adapter_load_underway_callback),
adapter, G_CONNECT_SWAPPED);
g_signal_connect_object (adapter->details->load_strategy, "report_load_progress",
G_CALLBACK (nautilus_adapter_load_progress_callback),
adapter, G_CONNECT_SWAPPED);
g_signal_connect_object (adapter->details->load_strategy, "report_load_complete",
G_CALLBACK (nautilus_adapter_load_complete_callback),
adapter, G_CONNECT_SWAPPED);
g_signal_connect_object (adapter->details->load_strategy, "report_load_failed",
G_CALLBACK (nautilus_adapter_load_failed_callback),
adapter, G_CONNECT_SWAPPED);
/* complete the embedding */
gtk_container_add (GTK_CONTAINER (bin),
nautilus_adapter_embed_strategy_get_widget (adapter->details->embed_strategy));
/* hook up view signals. */
g_signal_connect (adapter->details->nautilus_view,
"load_location",
G_CALLBACK (nautilus_adapter_load_location_callback),
adapter);
g_signal_connect (adapter->details->nautilus_view,
"stop_loading",
G_CALLBACK (nautilus_adapter_stop_loading_callback),
adapter);
g_signal_connect_object (adapter->details->nautilus_view, "load_location",
G_CALLBACK (nautilus_adapter_load_location_callback), adapter, 0);
g_signal_connect_object (adapter->details->nautilus_view, "stop_loading",
G_CALLBACK (nautilus_adapter_stop_loading_callback), adapter, 0);
return adapter;
}
......
......@@ -158,10 +158,8 @@ nautilus_hardware_view_init (NautilusHardwareView *hardware_view)
hardware_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (hardware_view));
g_signal_connect (hardware_view->details->nautilus_view,
"load_location",
G_CALLBACK (hardware_view_load_location_callback),
hardware_view);
g_signal_connect_object (hardware_view->details->nautilus_view, "load_location",
G_CALLBACK (hardware_view_load_location_callback), hardware_view, 0);
background = eel_get_widget_background (GTK_WIDGET (hardware_view));
eel_background_set_color (background, HARDWARE_DEFAULT_BACKGROUND_COLOR);
......
......@@ -38,6 +38,7 @@
#include <gtk/gtkscrolledwindow.h>
#include <libgnome/gnome-macros.h>
#include <libnautilus-private/nautilus-bookmark.h>
#include <libnautilus/nautilus-view.h>
#include <libnautilus/nautilus-view-standard-main.h>
#define FACTORY_IID "OAFIID:nautilus_history_view_factory:912d6634-d18f-40b6-bb83-bdfe16f1d15e"
......@@ -245,8 +246,8 @@ nautilus_history_view_instance_init (NautilusHistoryView *view)
(selection, "changed",
G_CALLBACK (on_selection_changed), view, 0);
g_signal_connect (view, "history_changed",
G_CALLBACK (history_changed_callback), view);
g_signal_connect_object (view, "history_changed",
G_CALLBACK (history_changed_callback), view, 0);
}
......
......@@ -77,18 +77,15 @@ nautilus_content_loser_init (NautilusContentLoser *view)
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
g_signal_connect (view->details->nautilus_view,
"load_location",
G_CALLBACK (loser_load_location_callback),
view);
g_signal_connect_object (view->details->nautilus_view, "load_location",
G_CALLBACK (loser_load_location_callback), view, 0);
/* Get notified when our bonobo control is activated so we
* can merge menu & toolbar items into Nautilus's UI.
*/
g_signal_connect (nautilus_view_get_bonobo_control (view->details->nautilus_view),
"activate",
G_CALLBACK (loser_merge_bonobo_items_callback),
view);
g_signal_connect_object (nautilus_view_get_bonobo_control (view->details->nautilus_view),
"activate",
G_CALLBACK (loser_merge_bonobo_items_callback), view, 0);
gtk_widget_show (GTK_WIDGET (view));
}
......
......@@ -79,19 +79,15 @@ nautilus_sidebar_loser_init (NautilusSidebarLoser *view)
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
g_signal_connect (view->details->nautilus_view,
"load_location",
G_CALLBACK (loser_load_location_callback),
view);
g_signal_connect_object (view->details->nautilus_view, "load_location",
G_CALLBACK (loser_load_location_callback), view, 0);
/*
* Get notified when our bonobo control is activated so we
/* Get notified when our bonobo control is activated so we
* can merge menu & toolbar items into Nautilus's UI.
*/
g_signal_connect (nautilus_view_get_bonobo_control (view->details->nautilus_view),
"activate",
G_CALLBACK (loser_merge_bonobo_items_callback),
view);
g_signal_connect_object (nautilus_view_get_bonobo_control (view->details->nautilus_view),
"activate",
G_CALLBACK (loser_merge_bonobo_items_callback), view, 0);
gtk_widget_show (GTK_WIDGET (view));
}
......
......@@ -220,7 +220,7 @@ static void streaming_save_browse_cb(GtkWidget * w, gpointer data)
{
streaming_save_dirbrowser = xmms_create_dir_browser(_("Select the directory where you want to store the MPEG streams:"),
mpg123_cfg.save_http_path, GTK_SELECTION_SINGLE, streaming_save_dirbrowser_cb);
g_signal_connect(G_OBJECT(streaming_save_dirbrowser), "destroy", G_CALLBACK(gtk_widget_destroyed), &streaming_save_dirbrowser);
g_signal_connect(streaming_save_dirbrowser, "destroy", G_CALLBACK(gtk_widget_destroyed), &streaming_save_dirbrowser);
gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), GTK_WINDOW(mpg123_configurewin));
gtk_widget_show(streaming_save_dirbrowser);
}
......@@ -275,8 +275,8 @@ void mpg123_configure(void)
return;
}
mpg123_configurewin = gtk_window_new(GTK_WINDOW_DIALOG);
g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy", G_CALLBACK(gtk_widget_destroyed), &mpg123_configurewin);
g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy", G_CALLBACK(configure_destroy), &mpg123_configurewin);
g_signal_connect(mpg123_configurewin, "destroy", G_CALLBACK(gtk_widget_destroyed), &mpg123_configurewin);
g_signal_connect(mpg123_configurewin, "destroy", G_CALLBACK(configure_destroy), &mpg123_configurewin);
gtk_window_set_title(GTK_WINDOW(mpg123_configurewin), _("MPG123 Configuration"));
gtk_window_set_wmclass(GTK_WINDOW(mpg123_configurewin), "mpg123_configuration", "Nautilus");
gtk_window_set_policy(GTK_WINDOW(mpg123_configurewin), FALSE, FALSE, FALSE);
......@@ -430,14 +430,14 @@ void mpg123_configure(void)
if (mpg123_cfg.use_3dnow == 0)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(auto_select), TRUE);
gtk_box_pack_start(GTK_BOX(decoder_vbox), auto_select, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(auto_select), "clicked", G_CALLBACK(auto_select_cb), NULL);
g_signal_connect(auto_select, "clicked", G_CALLBACK(auto_select_cb), NULL);
gtk_widget_show(auto_select);
decoder_3dnow = gtk_radio_button_new_with_label(NULL, _("use 3DNow! optimized decoder"));
if (((support_3dnow() == TRUE) && mpg123_cfg.use_3dnow != 2) || (mpg123_cfg.use_3dnow == 1))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_3dnow), TRUE);
gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_3dnow, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(decoder_3dnow), "clicked", G_CALLBACK(use_3dnow_cb), NULL);
g_signal_connect(decoder_3dnow, "clicked", G_CALLBACK(use_3dnow_cb), NULL);
gtk_widget_show(decoder_3dnow);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_select)) == TRUE)
gtk_widget_set_sensitive(decoder_3dnow, FALSE);
......@@ -446,7 +446,7 @@ void mpg123_configure(void)
if (((support_3dnow() == FALSE) && mpg123_cfg.use_3dnow != 1) || (mpg123_cfg.use_3dnow == 2))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_fpu), TRUE);
gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_fpu, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(decoder_fpu), "clicked", G_CALLBACK(use_fpu_cb), NULL);
g_signal_connect(decoder_fpu, "clicked", G_CALLBACK(use_fpu_cb), NULL);
gtk_widget_show(decoder_fpu);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_select)) == TRUE)
gtk_widget_set_sensitive(decoder_fpu, FALSE);
......@@ -527,7 +527,7 @@ void mpg123_configure(void)
streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use), mpg123_cfg.use_proxy);
g_signal_connect(G_OBJECT(streaming_proxy_use), "clicked", G_CALLBACK(proxy_use_cb), NULL);
g_signal_connect(streaming_proxy_use, "clicked", G_CALLBACK(proxy_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use, FALSE, FALSE, 0);
gtk_widget_show(streaming_proxy_use);
......@@ -561,7 +561,7 @@ void mpg123_configure(void)
streaming_proxy_auth_use = gtk_check_button_new_with_label(_("Use authentication"));
gtk_widget_set_sensitive(streaming_proxy_auth_use, mpg123_cfg.use_proxy);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), mpg123_cfg.proxy_use_auth);
g_signal_connect(G_OBJECT(streaming_proxy_auth_use), "clicked", G_CALLBACK(proxy_auth_use_cb), NULL);
g_signal_connect(streaming_proxy_auth_use, "clicked", G_CALLBACK(proxy_auth_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_use, FALSE, FALSE, 0);
gtk_widget_show(streaming_proxy_auth_use);
......@@ -608,7 +608,7 @@ void mpg123_configure(void)
streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), mpg123_cfg.save_http_stream);
g_signal_connect(G_OBJECT(streaming_save_use), "clicked", G_CALLBACK(streaming_save_use_cb), NULL);
g_signal_connect(streaming_save_use, "clicked", G_CALLBACK(streaming_save_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0);
gtk_widget_show(streaming_save_use);
......@@ -626,7 +626,7 @@ void mpg123_configure(void)
gtk_widget_show(streaming_save_entry);
streaming_save_browse = gtk_button_new_with_label(_("Browse"));
g_signal_connect(G_OBJECT(streaming_save_browse), "clicked", G_CALLBACK(streaming_save_browse_cb), NULL);
g_signal_connect(streaming_save_browse, "clicked", G_CALLBACK(streaming_save_browse_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0);
gtk_widget_show(streaming_save_browse);
......@@ -666,7 +666,7 @@ void mpg123_configure(void)
title_id3_use = gtk_check_button_new_with_label(_("Use ID3 tags"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3_use), mpg123_cfg.use_id3);
g_signal_connect(G_OBJECT(title_id3_use), "clicked", title_id3_use_cb, NULL);
g_signal_connect(title_id3_use, "clicked", title_id3_use_cb, NULL);
gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_use, FALSE, FALSE, 0);
gtk_widget_show(title_id3_use);
......@@ -718,14 +718,14 @@ void mpg123_configure(void)
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
ok = gtk_button_new_from_stock (GTK_STOCK_OK);
g_signal_connect(G_OBJECT(ok), "clicked", G_CALLBACK(mpg123_configurewin_ok), NULL);
g_signal_connect(ok, "clicked", G_CALLBACK(mpg123_configurewin_ok), NULL);
GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
gtk_widget_show(ok);
gtk_widget_grab_default(ok);
cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
g_signal_connect_object(G_OBJECT(cancel), "clicked", G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(mpg123_configurewin));
g_signal_connect_object(cancel, "clicked", G_CALLBACK(gtk_widget_destroy), mpg123_configurewin, 0);
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
gtk_widget_show(cancel);
......
......@@ -217,7 +217,7 @@ void mpg123_file_info_box(char *filename)
window = gtk_window_new(GTK_WINDOW_DIALOG);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_widget_destroyed), &window);
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
vbox = gtk_vbox_new(FALSE, 10);
......@@ -304,18 +304,18 @@ void mpg123_file_info_box(char *filename)
gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0);
save = gtk_button_new_with_label(_("Save"));
g_signal_connect(G_OBJECT(save), "clicked", G_CALLBACK(save_cb), NULL);
g_signal_connect(save, "clicked", G_CALLBACK(save_cb), NULL);
GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0);
gtk_widget_grab_default(save);
remove_id3 = gtk_button_new_with_label(_("Remove ID3"));
g_signal_connect(G_OBJECT(remove_id3), "clicked", G_CALLBACK(remove_id3_cb), NULL);
g_signal_connect(remove_id3, "clicked", G_CALLBACK(remove_id3_cb), NULL);
GTK_WIDGET_SET_FLAGS(remove_id3, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), remove_id3, TRUE, TRUE, 0);
cancel = gtk_button_new_with_label(_("Cancel"));
g_signal_connect_swapped(G_OBJECT(cancel), "clicked", G_CALLBACK(gtk_widget_destroy), G_OBJECT(window));
g_signal_connect_object(cancel, "clicked", G_CALLBACK(gtk_widget_destroy), window, G_CONNECT_SWAPPED);
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
......
......@@ -421,24 +421,18 @@ nautilus_music_view_init (NautilusMusicView *music_view)
music_view->details->event_box = gtk_event_box_new ();
gtk_widget_show (music_view->details->event_box);
g_signal_connect (music_view->details->event_box,
"drag_data_received",
G_CALLBACK (nautilus_music_view_drag_data_received),
music_view);
g_signal_connect_object (music_view->details->event_box, "drag_data_received",
G_CALLBACK (nautilus_music_view_drag_data_received), music_view, 0);
nautilus_view_construct (NAUTILUS_VIEW (music_view),
music_view->details->event_box);
g_signal_connect (music_view,
"load_location",
G_CALLBACK (music_view_load_location_callback),
music_view);
g_signal_connect_object (music_view, "load_location",
G_CALLBACK (music_view_load_location_callback), music_view, 0);
g_signal_connect (eel_get_widget_background (GTK_WIDGET (music_view->details->event_box)),
"appearance_changed",
G_CALLBACK (music_view_background_appearance_changed_callback),
music_view);
g_signal_connect_object (eel_get_widget_background (GTK_WIDGET (music_view->details->event_box)),
"appearance_changed",
G_CALLBACK (music_view_background_appearance_changed_callback), music_view, 0);
/* NOTE: we don't show the widgets until the directory has been loaded,
to avoid showing degenerate widgets during the loading process */
......@@ -564,7 +558,7 @@ nautilus_music_view_finalize (GObject *object)
g_free (music_view->details);
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gboolean
......@@ -772,12 +766,10 @@ set_album_cover (GtkWidget *widget, gpointer *data)
}
/* Callback used when the color selection dialog is destroyed */
static gboolean
dialog_destroy (GtkWidget *widget, gpointer data)
static void
dialog_destroy (GtkObject *object, gpointer callback_data)
{
NautilusMusicView *music_view = NAUTILUS_MUSIC_VIEW (data);
music_view->details->dialog = NULL;
return FALSE;
NAUTILUS_MUSIC_VIEW (callback_data)->details->dialog = NULL;
}
/* handle the set image button by displaying a file selection dialog */
......@@ -796,22 +788,13 @@ image_button_callback (GtkWidget * widget, NautilusMusicView *music_view)
(_("Select an image file for the album cover:"));
file_dialog = GTK_FILE_SELECTION (music_view->details->dialog);
g_signal_connect (music_view->details->dialog,
"destroy",
(GtkSignalFunc) dialog_destroy,
music_view);
g_signal_connect (file_dialog->ok_button,
"clicked",
(GtkSignalFunc) set_album_cover,
music_view);
g_signal_connect_object (music_view->details->dialog, "destroy",
G_CALLBACK (dialog_destroy), music_view, 0);
g_signal_connect_object (file_dialog->ok_button, "clicked",
G_CALLBACK (set_album_cover), music_view, 0);
g_signal_connect_closure (file_dialog->cancel_button,
"clicked",
g_cclosure_new_swap (
G_CALLBACK (gtk_widget_destroy),
file_dialog,
NULL),
0);
g_signal_connect_object (file_dialog->cancel_button, "clicked",
G_CALLBACK (gtk_widget_destroy), file_dialog, G_CONNECT_SWAPPED);
gtk_window_set_position (GTK_WINDOW (file_dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (file_dialog), "file_selector", "Nautilus");
......@@ -1181,7 +1164,7 @@ play_current_file (NautilusMusicView *music_view, gboolean from_start)
/* Check gconf sound preference */
client = gconf_client_get_default ();
enable_esd = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
g_object_unref (G_OBJECT (client));
g_object_unref (client);
if (!enable_esd) {
eel_show_error_dialog (_("Sorry, but the music view is unable to play back sound right now. "
......@@ -1503,12 +1486,12 @@ add_play_controls (NautilusMusicView *music_view)
music_view->details->playtime_adjustment = gtk_adjustment_new (0, 0, 101, 1, 5, 1);
music_view->details->playtime_bar = gtk_hscale_new (GTK_ADJUSTMENT (music_view->details->playtime_adjustment));
g_signal_connect (music_view->details->playtime_bar, "button_press_event",
G_CALLBACK (slider_press_callback), music_view);
g_signal_connect (music_view->details->playtime_bar, "button_release_event",
G_CALLBACK (slider_release_callback), music_view);
g_signal_connect (music_view->details->playtime_bar, "motion_notify_event",
G_CALLBACK (slider_moved_callback), music_view);
g_signal_connect_object (music_view->details->playtime_bar, "button_press_event",
G_CALLBACK (slider_press_callback), music_view, 0);
g_signal_connect_object (music_view->details->playtime_bar, "button_release_event",
G_CALLBACK (slider_release_callback), music_view, 0);
g_signal_connect_object (music_view->details->playtime_bar, "motion_notify_event",
G_CALLBACK (slider_moved_callback), music_view, 0);
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), music_view->details->playtime_bar,
_("Drag to seek within track"), NULL);
......@@ -1540,7 +1523,8 @@ add_play_controls (NautilusMusicView *music_view)
music_view->details->previous_track_button = gtk_button_new ();
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), music_view->details->previous_track_button, _("Previous"), NULL);
gtk_container_add (GTK_CONTAINER (music_view->details->previous_track_button), box);
g_signal_connect (music_view->details->previous_track_button, "clicked", G_CALLBACK (prev_button_callback), music_view);
g_signal_connect_object (music_view->details->previous_track_button, "clicked",
G_CALLBACK (prev_button_callback), music_view, 0);
gtk_widget_set_sensitive (music_view->details->previous_track_button, TRUE);
gtk_button_set_relief (GTK_BUTTON (music_view->details->previous_track_button), GTK_RELIEF_NORMAL);
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->previous_track_button, FALSE, FALSE, 0);
......@@ -1556,7 +1540,7 @@ add_play_controls (NautilusMusicView *music_view)
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
gtk_container_add (GTK_CONTAINER (button), box);
gtk_widget_set_sensitive (button, TRUE);
g_signal_connect (button, "clicked", G_CALLBACK (play_button_callback), music_view);
g_signal_connect_object (button, "clicked", G_CALLBACK (play_button_callback), music_view, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
......@@ -1571,8 +1555,8 @@ add_play_controls (NautilusMusicView *music_view)
gtk_container_add (GTK_CONTAINER (music_view->details->pause_button), box);
gtk_widget_set_sensitive (music_view->details->pause_button, TRUE);
g_signal_connect (music_view->details->pause_button, "clicked",
G_CALLBACK(pause_button_callback), music_view);
g_signal_connect_object (music_view->details->pause_button, "clicked",
G_CALLBACK (pause_button_callback), music_view, 0);
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->pause_button, FALSE, FALSE, 0);
gtk_widget_show (music_view->details->pause_button);
......@@ -1585,8 +1569,8 @@ add_play_controls (NautilusMusicView *music_view)
gtk_container_add (GTK_CONTAINER (music_view->details->stop_button), box);
gtk_widget_set_sensitive (music_view->details->stop_button, TRUE);
g_signal_connect (music_view->details->stop_button, "clicked",
G_CALLBACK (stop_button_callback), music_view);
g_signal_connect_object (music_view->details->stop_button, "clicked",
G_CALLBACK (stop_button_callback), music_view, 0);
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->stop_button, FALSE, FALSE, 0);
gtk_widget_show (music_view->details->stop_button);
......@@ -1599,8 +1583,8 @@ add_play_controls (NautilusMusicView *music_view)
gtk_container_add (GTK_CONTAINER (music_view->details->next_track_button), box);
gtk_widget_set_sensitive (music_view->details->next_track_button, TRUE);
g_signal_connect (music_view->details->next_track_button, "clicked",
G_CALLBACK (next_button_callback), music_view);
g_signal_connect_object (music_view->details->next_track_button, "clicked",
G_CALLBACK (next_button_callback), music_view, 0);
gtk_box_pack_start (GTK_BOX (hbox), music_view->details->next_track_button, FALSE, FALSE, 0);
gtk_widget_show (music_view->details->next_track_button);
......
......@@ -195,7 +195,7 @@ nautilus_cell_renderer_news_finalize (GObject *object)
g_free (cellnews->priv);