summaryrefslogtreecommitdiff
path: root/src/eom-thumb-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eom-thumb-view.c')
-rw-r--r--src/eom-thumb-view.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c
index 3a2ddf4..0b28440 100644
--- a/src/eom-thumb-view.c
+++ b/src/eom-thumb-view.c
@@ -78,7 +78,7 @@ struct _EomThumbViewPrivate {
gint end_thumb; /* the last visible thumbnail */
GtkWidget *menu; /* a contextual menu for thumbnails */
GtkCellRenderer *pixbuf_cell;
- gint visible_range_changed_id;
+ guint visible_range_changed_id;
GtkOrientation orientation;
gint n_images;
@@ -167,17 +167,24 @@ eom_thumb_view_dispose (GObject *object)
priv->visible_range_changed_id = 0;
}
- model = gtk_icon_view_get_model (GTK_ICON_VIEW (object));
-
- if (model && priv->image_add_id != 0) {
- g_signal_handler_disconnect (model, priv->image_add_id);
- priv->image_add_id = 0;
+#if GLIB_CHECK_VERSION(2,62,0)
+ if ((model = gtk_icon_view_get_model (GTK_ICON_VIEW (object))) != NULL) {
+ g_clear_signal_handler (&priv->image_add_id, model);
+ g_clear_signal_handler (&priv->image_removed_id, model);
}
+#else
+ if ((model = gtk_icon_view_get_model (GTK_ICON_VIEW (object))) != NULL) {
+ if (priv->image_add_id != 0) {
+ g_signal_handler_disconnect (model, priv->image_add_id);
+ priv->image_add_id = 0;
+ }
- if (model && priv->image_removed_id) {
- g_signal_handler_disconnect (model, priv->image_removed_id);
- priv->image_removed_id = 0;
+ if (priv->image_removed_id != 0) {
+ g_signal_handler_disconnect (model, priv->image_removed_id);
+ priv->image_removed_id = 0;
+ }
}
+#endif
G_OBJECT_CLASS (eom_thumb_view_parent_class)->dispose (object);
}