[gthumb] image viewer: connect the signal only once



commit 29a05bee8941b06cb0e4885bd8fa1a8902ab17e3
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Feb 14 08:55:28 2020 +0100

    image viewer: connect the signal only once

 extensions/image_viewer/gth-image-viewer-page.c | 39 ++++++++++++-------------
 1 file changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 23392708..d8785be1 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -1266,26 +1266,6 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
 
        gth_browser_set_viewer_widget (browser, self->priv->image_navigator);
        gth_viewer_page_focus (GTH_VIEWER_PAGE (self));
-
-       /* settings notifications */
-
-       g_signal_connect (self->priv->settings,
-                         "changed::" PREF_IMAGE_VIEWER_ZOOM_QUALITY,
-                         G_CALLBACK (pref_zoom_quality_changed),
-                         self);
-       g_signal_connect (self->priv->settings,
-                         "changed::" PREF_IMAGE_VIEWER_ZOOM_CHANGE,
-                         G_CALLBACK (pref_zoom_change_changed),
-                         self);
-       g_signal_connect (self->priv->settings,
-                         "changed::" PREF_IMAGE_VIEWER_RESET_SCROLLBARS,
-                         G_CALLBACK (pref_reset_scrollbars_changed),
-                         self);
-       g_signal_connect (self->priv->settings,
-                         "changed::" PREF_IMAGE_VIEWER_TRANSPARENCY_STYLE,
-                         G_CALLBACK (pref_transparency_style_changed),
-                         self);
-
 }
 
 
@@ -2070,6 +2050,25 @@ gth_image_viewer_page_init (GthImageViewerPage *self)
                self->priv->prev_file_data[i] = NULL;
 
        self->priv->drag_data_get_event = 0;
+
+       /* settings notifications */
+
+       g_signal_connect (self->priv->settings,
+                         "changed::" PREF_IMAGE_VIEWER_ZOOM_QUALITY,
+                         G_CALLBACK (pref_zoom_quality_changed),
+                         self);
+       g_signal_connect (self->priv->settings,
+                         "changed::" PREF_IMAGE_VIEWER_ZOOM_CHANGE,
+                         G_CALLBACK (pref_zoom_change_changed),
+                         self);
+       g_signal_connect (self->priv->settings,
+                         "changed::" PREF_IMAGE_VIEWER_RESET_SCROLLBARS,
+                         G_CALLBACK (pref_reset_scrollbars_changed),
+                         self);
+       g_signal_connect (self->priv->settings,
+                         "changed::" PREF_IMAGE_VIEWER_TRANSPARENCY_STYLE,
+                         G_CALLBACK (pref_transparency_style_changed),
+                         self);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]