summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2002-01-09 21:02:31 +0000
committerDarin Adler <darin@src.gnome.org>2002-01-09 21:02:31 +0000
commit47c7d71426d427b0c38149a7a77446ef279c3cd1 (patch)
tree0fbe63223dd311677608cf86c6fe67a004ec7a14 /src
parentbd775f98b4d501d7d4c58a30e874ec79310f1ee7 (diff)
downloadnautilus-47c7d71426d427b0c38149a7a77446ef279c3cd1.tar.gz
Some destroy/finalize fixes.
* src/file-manager/fm-directory-view.c: (fm_directory_view_destroy), (fm_directory_view_finalize), (fm_directory_view_class_init): * src/file-manager/fm-icon-view.c: (fm_icon_view_finalize), (fm_icon_view_class_init): * src/file-manager/fm-list-view.c: (fm_list_view_class_init), (fm_list_view_finalize): Some destroy/finalize fixes.
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-directory-view.c41
-rw-r--r--src/file-manager/fm-icon-view.c8
-rw-r--r--src/file-manager/fm-list-view.c10
3 files changed, 32 insertions, 27 deletions
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index f77c5e97e..59350df3c 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -259,8 +259,8 @@ typedef struct {
static void cancel_activate_callback (gpointer callback_data);
static gboolean display_selection_info_idle_callback (gpointer data);
static gboolean file_is_launchable (NautilusFile *file);
-static void fm_directory_view_class_init (FMDirectoryViewClass *klass);
-static void fm_directory_view_init (FMDirectoryView *view);
+static void fm_directory_view_class_init (FMDirectoryViewClass *klass);
+static void fm_directory_view_init (FMDirectoryView *view);
static void fm_directory_view_duplicate_selection (FMDirectoryView *view,
GList *files,
GArray *item_locations);
@@ -1296,7 +1296,6 @@ static void
fm_directory_view_destroy (GtkObject *object)
{
FMDirectoryView *view;
- GList *node, *next;
view = FM_DIRECTORY_VIEW (object);
@@ -1312,6 +1311,17 @@ fm_directory_view_destroy (GtkObject *object)
fm_directory_view_stop (view);
fm_directory_view_clear (view);
+ EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+}
+
+static void
+fm_directory_view_finalize (GObject *object)
+{
+ FMDirectoryView *view;
+ GList *node, *next;
+
+ view = FM_DIRECTORY_VIEW (object);
+
for (node = view->details->scripts_directory_list; node != NULL; node = next) {
next = node->next;
remove_scripts_directory (view, node->data);
@@ -1361,7 +1371,7 @@ fm_directory_view_destroy (GtkObject *object)
g_free (view->details);
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
/**
@@ -5653,15 +5663,14 @@ real_sort_files (FMDirectoryView *view, GList **files)
static void
fm_directory_view_class_init (FMDirectoryViewClass *klass)
{
- GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkScrolledWindowClass *scrolled_window_class;
- object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
scrolled_window_class = GTK_SCROLLED_WINDOW_CLASS (klass);
- object_class->destroy = fm_directory_view_destroy;
+ G_OBJECT_CLASS (klass)->finalize = fm_directory_view_finalize;
+ GTK_OBJECT_CLASS (klass)->destroy = fm_directory_view_destroy;
widget_class->realize = real_realize;
widget_class->selection_clear_event = real_selection_clear_event;
@@ -5676,7 +5685,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
signals[ADD_FILE] =
g_signal_new ("add_file",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, add_file),
NULL, NULL,
@@ -5684,7 +5693,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 1, NAUTILUS_TYPE_FILE);
signals[BEGIN_FILE_CHANGES] =
g_signal_new ("begin_file_changes",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, begin_file_changes),
NULL, NULL,
@@ -5692,7 +5701,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 0);
signals[BEGIN_LOADING] =
g_signal_new ("begin_loading",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, begin_loading),
NULL, NULL,
@@ -5700,7 +5709,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 0);
signals[CLEAR] =
g_signal_new ("clear",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, clear),
NULL, NULL,
@@ -5708,7 +5717,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 0);
signals[END_FILE_CHANGES] =
g_signal_new ("end_file_changes",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, end_file_changes),
NULL, NULL,
@@ -5716,7 +5725,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 0);
signals[END_LOADING] =
g_signal_new ("end_loading",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, end_loading),
NULL, NULL,
@@ -5724,7 +5733,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 0);
signals[FILE_CHANGED] =
g_signal_new ("file_changed",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, file_changed),
NULL, NULL,
@@ -5732,7 +5741,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 1, NAUTILUS_TYPE_FILE);
signals[LOAD_ERROR] =
g_signal_new ("load_error",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, load_error),
NULL, NULL,
@@ -5740,7 +5749,7 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
G_TYPE_NONE, 1, G_TYPE_INT);
signals[REMOVE_FILE] =
g_signal_new ("remove_file",
- G_TYPE_FROM_CLASS (object_class),
+ G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (FMDirectoryViewClass, remove_file),
NULL, NULL,
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index ef348053d..574bd4737 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -232,7 +232,7 @@ struct FMIconViewDetails
};
static void
-fm_icon_view_destroy (GtkObject *object)
+fm_icon_view_finalize (GObject *object)
{
FMIconView *icon_view;
@@ -256,7 +256,7 @@ fm_icon_view_destroy (GtkObject *object)
nautilus_file_list_free (icon_view->details->icons_not_positioned);
g_free (icon_view->details);
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static NautilusIconContainer *
@@ -2722,13 +2722,11 @@ icon_view_handle_uri_list (NautilusIconContainer *container, const char *item_ur
static void
fm_icon_view_class_init (FMIconViewClass *klass)
{
- GtkObjectClass *object_class;
FMDirectoryViewClass *fm_directory_view_class;
- object_class = GTK_OBJECT_CLASS (klass);
fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass);
- object_class->destroy = fm_icon_view_destroy;
+ G_OBJECT_CLASS (klass)->finalize = fm_icon_view_finalize;
fm_directory_view_class->add_file = fm_icon_view_add_file;
fm_directory_view_class->begin_loading = fm_icon_view_begin_loading;
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index 49070ed9e..703c4f305 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -122,7 +122,7 @@ static NautilusZoomLevel fm_list_view_get_zoom_level (FMListVie
static void fm_list_view_init (gpointer object,
gpointer klass);
static void fm_list_view_class_init (gpointer klass);
-static void fm_list_view_destroy (GtkObject *object);
+static void fm_list_view_finalize (GObject *object);
static void fm_list_view_end_file_changes (FMDirectoryView *view);
static void fm_list_view_reset_to_defaults (FMDirectoryView *view);
static void fm_list_view_select_all (FMDirectoryView *view);
@@ -189,15 +189,13 @@ EEL_CLASS_BOILERPLATE (FMListView,
static void
fm_list_view_class_init (gpointer klass)
{
- GtkObjectClass *object_class;
FMDirectoryViewClass *fm_directory_view_class;
FMListViewClass *fm_list_view_class;
- object_class = GTK_OBJECT_CLASS (klass);
fm_directory_view_class = FM_DIRECTORY_VIEW_CLASS (klass);
fm_list_view_class = FM_LIST_VIEW_CLASS (klass);
- object_class->destroy = fm_list_view_destroy;
+ G_OBJECT_CLASS (klass)->finalize = fm_list_view_finalize;
fm_directory_view_class->add_file = fm_list_view_add_file;
fm_directory_view_class->begin_file_changes = fm_list_view_begin_file_changes;
@@ -300,10 +298,10 @@ fm_list_view_init (gpointer object, gpointer klass)
}
static void
-fm_list_view_destroy (GtkObject *object)
+fm_list_view_finalize (GObject *object)
{
g_free (FM_LIST_VIEW (object)->details);
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+ EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static void