[gnome-control-center] background: Simplify background-chosen signal



commit 7c436727a3c5a2926b062ab719e57c84b6801f02
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 11 15:40:38 2020 +0100

    background: Simplify background-chosen signal
    
    Now that there's only a single background to set, there's no use for
    a flag parameter to specify the background(s).
    
    https://gitlab.gnome.org/GNOME/gnome-control-center/issues/864

 panels/background/cc-background-chooser.c | 12 +++++-------
 panels/background/cc-background-chooser.h |  7 -------
 panels/background/cc-background-panel.c   |  1 -
 3 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/panels/background/cc-background-chooser.c b/panels/background/cc-background-chooser.c
index b4db160cf..0ddc0fcb1 100644
--- a/panels/background/cc-background-chooser.c
+++ b/panels/background/cc-background-chooser.c
@@ -55,8 +55,7 @@ enum
 static guint signals [N_SIGNALS];
 
 static void
-emit_background_chosen (CcBackgroundChooser        *self,
-                        CcBackgroundSelectionFlags  flags)
+emit_background_chosen (CcBackgroundChooser *self)
 {
   g_autoptr(GList) list = NULL;
   CcBackgroundItem *item;
@@ -68,7 +67,7 @@ emit_background_chosen (CcBackgroundChooser        *self,
 
   item = g_object_get_data (list->data, "item");
 
-  g_signal_emit (self, signals[BACKGROUND_CHOSEN], 0, item, flags);
+  g_signal_emit (self, signals[BACKGROUND_CHOSEN], 0, item);
 
   gtk_flow_box_unselect_all (flowbox);
 }
@@ -184,7 +183,7 @@ on_item_activated_cb (GtkFlowBox          *flowbox,
                       CcBackgroundChooser *self)
 {
   self->recent_selected = flowbox == self->recent_flowbox;
-  emit_background_chosen (self, CC_BACKGROUND_SELECTION_DESKTOP);
+  emit_background_chosen (self);
 }
 
 static void
@@ -277,9 +276,8 @@ cc_background_chooser_class_init (CcBackgroundChooserClass *klass)
                                              G_SIGNAL_RUN_FIRST,
                                              0, NULL, NULL, NULL,
                                              G_TYPE_NONE,
-                                             2,
-                                             CC_TYPE_BACKGROUND_ITEM,
-                                             G_TYPE_INT);
+                                             1,
+                                             CC_TYPE_BACKGROUND_ITEM);
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/control-center/background/cc-background-chooser.ui");
 
diff --git a/panels/background/cc-background-chooser.h b/panels/background/cc-background-chooser.h
index ced15191b..175109829 100644
--- a/panels/background/cc-background-chooser.h
+++ b/panels/background/cc-background-chooser.h
@@ -24,13 +24,6 @@
 
 G_BEGIN_DECLS
 
-typedef enum
-{
-  CC_BACKGROUND_SELECTION_NONE        = 0,
-  CC_BACKGROUND_SELECTION_DESKTOP     = 1 << 0,
-  CC_BACKGROUND_SELECTION_LOCK_SCREEN = 1 << 1,
-} CcBackgroundSelectionFlags;
-
 #define CC_TYPE_BACKGROUND_CHOOSER (cc_background_chooser_get_type())
 G_DECLARE_FINAL_TYPE (CcBackgroundChooser, cc_background_chooser, CC, BACKGROUND_CHOOSER, GtkBox)
 
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index fc9bc0067..88d6d5237 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -229,7 +229,6 @@ set_background (CcBackgroundPanel *panel,
 static void
 on_chooser_background_chosen_cb (CcBackgroundChooser        *chooser,
                                  CcBackgroundItem           *item,
-                                 CcBackgroundSelectionFlags  flags,
                                  CcBackgroundPanel          *self)
 {
   set_background (self, self->settings, item);


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