[gnome-initial-setup/wip/wjt/fix-missing-symbol-without-cheese] account: Always define all callbacks mentioned in .ui




commit 7787adbbf4eebcc38a14a35c545353c2aa0450be
Author: Will Thompson <wjt endlessm com>
Date:   Wed Oct 14 07:32:02 2020 +0100

    account: Always define all callbacks mentioned in .ui
    
    Previously, webcam_icon_selected was only defined if gnome-initial-setup
    was built with Cheese support. However, it is always mentioned in the
    .ui file. This leads to the following warning at runtime:
    
        Could not find signal handler 'webcam_icon_selected'.  Did you compile with -rdynamic?
    
    Define a dummy callback in the no-Cheese case. Warn if it is called.
    (The button should always be hidden if Cheese is not available, so it
    should never be called.)
    
    Fixes #114.

 gnome-initial-setup/pages/account/um-photo-dialog.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/um-photo-dialog.c 
b/gnome-initial-setup/pages/account/um-photo-dialog.c
index 709c619d..32f90c15 100644
--- a/gnome-initial-setup/pages/account/um-photo-dialog.c
+++ b/gnome-initial-setup/pages/account/um-photo-dialog.c
@@ -158,6 +158,12 @@ cheese_camera_device_monitor_new_cb (GObject *source,
         um->monitor = CHEESE_CAMERA_DEVICE_MONITOR (ret);
         setup_cheese_camera_device_monitor (um);
 }
+#else /* ! HAVE_CHEESE */
+static void
+webcam_icon_selected (UmPhotoDialog *um)
+{
+  g_warning ("Webcam icon selected, but compiled without Cheese support");
+}
 #endif /* HAVE_CHEESE */
 
 static void
@@ -463,9 +469,7 @@ um_photo_dialog_class_init (UmPhotoDialogClass *klass)
         gtk_widget_class_bind_template_child (wclass, UmPhotoDialog, flowbox);
         gtk_widget_class_bind_template_child (wclass, UmPhotoDialog, recent_pictures);
         gtk_widget_class_bind_template_child (wclass, UmPhotoDialog, take_picture_button);
-#ifdef HAVE_CHEESE
         gtk_widget_class_bind_template_callback (wclass, webcam_icon_selected);
-#endif
 
         oclass->dispose = um_photo_dialog_dispose;
 }


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