summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-31 04:42:15 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:51 +0200
commit2472d52a0f28dd84d362dcc5570e747a82aa8ba6 (patch)
tree3761aac83f319d8e4fb76286b0a5e1f3e2430fe9 /src/file-manager
parentae33b1c624c008ca0818ab08735968c8d01fae1c (diff)
downloadcaja-2472d52a0f28dd84d362dcc5570e747a82aa8ba6.tar.bz2
caja-2472d52a0f28dd84d362dcc5570e747a82aa8ba6.tar.xz
[src] don't use GtkObject (GTK3)
the ::destroy signal of GtkObject has only been moved to GtkWidget in GTK3 (after GtkObject removal): http://developer.gnome.org/gtk3/3.0/ch25s02.html So we use conditionals in this case, to keep it working with GTK2. A tad similar: http://git.gnome.org/browse/nautilus/commit/?id=cc6cb51e827c0b15d4ef09f12d37b9f331ddcef8
Diffstat (limited to 'src/file-manager')
-rw-r--r--src/file-manager/fm-desktop-icon-view.c3
-rw-r--r--src/file-manager/fm-directory-view.c32
-rw-r--r--src/file-manager/fm-icon-view.c18
-rw-r--r--src/file-manager/fm-properties-window.c12
4 files changed, 48 insertions, 17 deletions
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index ef9a84de..005bc198 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -460,7 +460,8 @@ do_desktop_rescan (gpointer data)
}
static void
-done_loading (GtkObject *DirectoryView, FMDesktopIconView *desktop_icon_view)
+done_loading (CajaDirectory *model,
+ FMDesktopIconView *desktop_icon_view)
{
struct stat buf;
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index bd75951e..a4119ec4 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -659,7 +659,7 @@ fm_directory_view_confirm_multiple (GtkWindow *parent_window,
g_free (detail);
response = gtk_dialog_run (dialog);
- gtk_object_destroy (GTK_OBJECT (dialog));
+ gtk_widget_destroy (GTK_WIDGET (dialog));
return response == GTK_RESPONSE_YES;
}
@@ -2096,7 +2096,11 @@ real_unmerge_menus (FMDirectoryView *view)
}
static void
+#if GTK_CHECK_VERSION (3, 0, 0)
+fm_directory_view_destroy (GtkWidget *object)
+#else
fm_directory_view_destroy (GtkObject *object)
+#endif
{
FMDirectoryView *view;
GList *node, *next;
@@ -2157,7 +2161,11 @@ fm_directory_view_destroy (GtkObject *object)
view->details->directory_as_file = NULL;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ EEL_CALL_PARENT (GTK_WIDGET_CLASS, destroy, (object));
+#else
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
+#endif
}
static void
@@ -2168,17 +2176,17 @@ fm_directory_view_finalize (GObject *object)
view = FM_DIRECTORY_VIEW (object);
g_signal_handlers_disconnect_by_func (caja_preferences,
- schedule_update_menus_callback, view);
+ schedule_update_menus_callback, view);
g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
- text_attribute_names_changed_callback, view);
+ text_attribute_names_changed_callback, view);
g_signal_handlers_disconnect_by_func (caja_preferences,
- image_display_policy_changed_callback, view);
+ image_display_policy_changed_callback, view);
g_signal_handlers_disconnect_by_func (caja_preferences,
- click_policy_changed_callback, view);
+ click_policy_changed_callback, view);
g_signal_handlers_disconnect_by_func (caja_preferences,
- sort_directories_first_changed_callback, view);
+ sort_directories_first_changed_callback, view);
g_signal_handlers_disconnect_by_func (mate_lockdown_preferences,
- schedule_update_menus, view);
+ schedule_update_menus, view);
unschedule_pop_up_location_context_menu (view);
if (view->details->location_popup_event != NULL) {
@@ -2738,7 +2746,7 @@ copy_move_done_callback (GHashTable *debuting_files, gpointer data)
* operate on. The ADD_FILE signal is registered as G_SIGNAL_RUN_LAST, so we
* must use connect_after.
*/
- g_signal_connect_data (GTK_OBJECT (directory_view),
+ g_signal_connect_data (directory_view,
"add_file",
G_CALLBACK (debuting_files_add_file_callback),
debuting_files_data,
@@ -10794,11 +10802,13 @@ fm_directory_view_class_init (FMDirectoryViewClass *klass)
widget_class = GTK_WIDGET_CLASS (klass);
scrolled_window_class = GTK_SCROLLED_WINDOW_CLASS (klass);
- G_OBJECT_CLASS (klass)->finalize = fm_directory_view_finalize;
G_OBJECT_CLASS (klass)->set_property = fm_directory_view_set_property;
-
+ G_OBJECT_CLASS (klass)->finalize = fm_directory_view_finalize;
+#if !GTK_CHECK_VERSION (3, 0, 0)
GTK_OBJECT_CLASS (klass)->destroy = fm_directory_view_destroy;
-
+#else
+ widget_class->destroy = fm_directory_view_destroy;
+#endif
widget_class->scroll_event = fm_directory_view_scroll_event;
widget_class->parent_set = fm_directory_view_parent_set;
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index eee45185..a9fb8b11 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -209,7 +209,11 @@ G_DEFINE_TYPE_WITH_CODE (FMIconView, fm_icon_view, FM_TYPE_DIRECTORY_VIEW,
fm_icon_view_iface_init));
static void
+#if GTK_CHECK_VERSION (3, 0, 0)
+fm_icon_view_destroy (GtkWidget *object)
+#else
fm_icon_view_destroy (GtkObject *object)
+#endif
{
FMIconView *icon_view;
@@ -237,10 +241,13 @@ fm_icon_view_destroy (GtkObject *object)
icon_view->details->icons_not_positioned = NULL;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GTK_WIDGET_CLASS (fm_icon_view_parent_class)->destroy (object);
+#else
GTK_OBJECT_CLASS (fm_icon_view_parent_class)->destroy (object);
+#endif
}
-
static void
fm_icon_view_finalize (GObject *object)
{
@@ -271,6 +278,7 @@ fm_icon_view_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (caja_compact_view_preferences,
all_columns_same_width_changed_callback,
icon_view);
+
G_OBJECT_CLASS (fm_icon_view_parent_class)->finalize (object);
}
@@ -2829,8 +2837,6 @@ fm_icon_view_sort_directories_first_changed (FMDirectoryView *directory_view)
}
}
-/* GtkObject methods. */
-
static gboolean
icon_view_can_accept_item (CajaIconContainer *container,
CajaFile *target_item,
@@ -3145,9 +3151,11 @@ fm_icon_view_class_init (FMIconViewClass *klass)
G_OBJECT_CLASS (klass)->set_property = fm_icon_view_set_property;
G_OBJECT_CLASS (klass)->finalize = fm_icon_view_finalize;
-
+#if !GTK_CHECK_VERSION (3, 0, 0)
GTK_OBJECT_CLASS (klass)->destroy = fm_icon_view_destroy;
-
+#else
+ GTK_WIDGET_CLASS (klass)->destroy = fm_icon_view_destroy;
+#endif
GTK_WIDGET_CLASS (klass)->screen_changed = fm_icon_view_screen_changed;
GTK_WIDGET_CLASS (klass)->scroll_event = fm_icon_view_scroll_event;
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index bb9f06cd..19eea640 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -5482,7 +5482,11 @@ real_response (GtkDialog *dialog,
}
static void
+#if GTK_CHECK_VERSION (3, 0, 0)
+real_destroy (GtkWidget *object)
+#else
real_destroy (GtkObject *object)
+#endif
{
FMPropertiesWindow *window;
GList *l;
@@ -5540,7 +5544,11 @@ real_destroy (GtkObject *object)
window->details->update_files_timeout_id = 0;
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GTK_WIDGET_CLASS (parent_class)->destroy (object);
+#else
GTK_OBJECT_CLASS (parent_class)->destroy (object);
+#endif
}
static void
@@ -5795,7 +5803,11 @@ fm_properties_window_class_init (FMPropertiesWindowClass *class)
GtkBindingSet *binding_set;
G_OBJECT_CLASS (class)->finalize = real_finalize;
+#if !GTK_CHECK_VERSION (3, 0, 0)
GTK_OBJECT_CLASS (class)->destroy = real_destroy;
+#else
+ GTK_WIDGET_CLASS (class)->destroy = real_destroy;
+#endif
GTK_DIALOG_CLASS (class)->response = real_response;
binding_set = gtk_binding_set_by_class (class);