[gtk+] GtkRecentChooser: Use G_PARAM_EXPLICIT_NOTIFY



commit f6e5f884547469e917f491355af25d3974416178
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 9 08:53:12 2014 -0400

    GtkRecentChooser: Use G_PARAM_EXPLICIT_NOTIFY

 gtk/deprecated/gtkrecentaction.c |   50 +++++++++++++---
 gtk/gtkrecentchooser.c           |  115 ++++++++++++++++++++------------------
 2 files changed, 102 insertions(+), 63 deletions(-)
---
diff --git a/gtk/deprecated/gtkrecentaction.c b/gtk/deprecated/gtkrecentaction.c
index 309140c..394aa6d 100644
--- a/gtk/deprecated/gtkrecentaction.c
+++ b/gtk/deprecated/gtkrecentaction.c
@@ -521,28 +521,60 @@ gtk_recent_action_set_property (GObject      *gobject,
   switch (prop_id)
     {
     case PROP_SHOW_NUMBERS:
-      priv->show_numbers = g_value_get_boolean (value);
+      if (priv->show_numbers != g_value_get_boolean (value))
+        {
+          priv->show_numbers = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_SHOW_PRIVATE:
-      priv->show_private = g_value_get_boolean (value);
+      if (priv->show_private != g_value_get_boolean (value))
+        {
+          priv->show_private = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_SHOW_NOT_FOUND:
-      priv->show_not_found = g_value_get_boolean (value);
+      if (priv->show_not_found != g_value_get_boolean (value))
+        {
+          priv->show_not_found = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_SHOW_TIPS:
-      priv->show_tips = g_value_get_boolean (value);
+      if (priv->show_tips != g_value_get_boolean (value))
+        {
+          priv->show_tips = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_SHOW_ICONS:
-      priv->show_icons = g_value_get_boolean (value);
+      if (priv->show_icons != g_value_get_boolean (value))
+        {
+          priv->show_icons = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_LIMIT:
-      priv->limit = g_value_get_int (value);
+      if (priv->limit != g_value_get_int (value))
+        {
+          priv->limit = g_value_get_int (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_LOCAL_ONLY:
-      priv->local_only = g_value_get_boolean (value);
+      if (priv->local_only != g_value_get_boolean (value))
+        {
+          priv->local_only = g_value_get_boolean (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_SORT_TYPE:
-      priv->sort_type = g_value_get_enum (value);
+      if (priv->sort_type != g_value_get_enum (value))
+        {
+          priv->sort_type = g_value_get_enum (value);
+          g_object_notify_by_pspec (gobject, pspec);
+        }
       break;
     case GTK_RECENT_CHOOSER_PROP_FILTER:
       set_current_filter (action, g_value_get_object (value));
@@ -645,7 +677,7 @@ gtk_recent_action_class_init (GtkRecentActionClass *klass)
                                                          P_("Show Numbers"),
                                                          P_("Whether the items should be displayed with a 
number"),
                                                          FALSE,
-                                                         G_PARAM_READWRITE));
+                                                         G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
 
 }
 
diff --git a/gtk/gtkrecentchooser.c b/gtk/gtkrecentchooser.c
index 8d6e6b4..e976db7 100644
--- a/gtk/gtkrecentchooser.c
+++ b/gtk/gtkrecentchooser.c
@@ -96,7 +96,7 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
                   NULL, NULL,
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
-   
+
   /**
    * GtkRecentChooser::item-activated:
    * @chooser: the object which received the signal
@@ -126,11 +126,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_object ("recent-manager",
-                                                           P_("Recent Manager"),
-                                                           P_("The RecentManager object to use"),
-                                                           GTK_TYPE_RECENT_MANAGER,
-                                                           GTK_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+                                       g_param_spec_object ("recent-manager",
+                                                            P_("Recent Manager"),
+                                                            P_("The RecentManager object to use"),
+                                                            GTK_TYPE_RECENT_MANAGER,
+                                                            GTK_PARAM_WRITABLE|G_PARAM_CONSTRUCT_ONLY));
+
   /**
    * GtkRecentManager:show-private:
    *
@@ -141,11 +142,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("show-private",
-                                                            P_("Show Private"),
-                                                            P_("Whether the private items should be 
displayed"),
-                                                            FALSE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("show-private",
+                                                             P_("Show Private"),
+                                                             P_("Whether the private items should be 
displayed"),
+                                                             FALSE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:show-tips:
    *
@@ -155,11 +157,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("show-tips",
-                                                            P_("Show Tooltips"),
-                                                            P_("Whether there should be a tooltip on the 
item"),
-                                                            FALSE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("show-tips",
+                                                             P_("Show Tooltips"),
+                                                             P_("Whether there should be a tooltip on the 
item"),
+                                                             FALSE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:show-icons:
    *
@@ -168,11 +171,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("show-icons",
-                                                            P_("Show Icons"),
-                                                            P_("Whether there should be an icon near the 
item"),
-                                                            TRUE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("show-icons",
+                                                             P_("Show Icons"),
+                                                             P_("Whether there should be an icon near the 
item"),
+                                                             TRUE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:show-not-found:
    *
@@ -184,11 +188,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("show-not-found",
-                                                            P_("Show Not Found"),
-                                                            P_("Whether the items pointing to unavailable 
resources should be displayed"),
-                                                            TRUE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("show-not-found",
+                                                             P_("Show Not Found"),
+                                                             P_("Whether the items pointing to unavailable 
resources should be displayed"),
+                                                             TRUE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:select-multiple:
    *
@@ -197,11 +202,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("select-multiple",
-                                                            P_("Select Multiple"),
-                                                            P_("Whether to allow multiple items to be 
selected"),
-                                                            FALSE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("select-multiple",
+                                                             P_("Select Multiple"),
+                                                             P_("Whether to allow multiple items to be 
selected"),
+                                                             FALSE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:local-only:
    *
@@ -211,11 +217,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_boolean ("local-only",
-                                                            P_("Local only"),
-                                                            P_("Whether the selected resource(s) should be 
limited to local file: URIs"),
-                                                            TRUE,
-                                                            GTK_PARAM_READWRITE));
+                                       g_param_spec_boolean ("local-only",
+                                                             P_("Local only"),
+                                                             P_("Whether the selected resource(s) should be 
limited to local file: URIs"),
+                                                             TRUE,
+                                                             GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:limit:
    *
@@ -225,13 +232,12 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_int ("limit",
-                                                        P_("Limit"),
-                                                        P_("The maximum number of items to be displayed"),
-                                                        -1,
-                                                        G_MAXINT,
-                                                        50,
-                                                        GTK_PARAM_READWRITE));
+                                       g_param_spec_int ("limit",
+                                                         P_("Limit"),
+                                                         P_("The maximum number of items to be displayed"),
+                                                         -1, G_MAXINT, 50,
+                                                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:sort-type:
    *
@@ -240,12 +246,13 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_enum ("sort-type",
-                                                         P_("Sort Type"),
-                                                         P_("The sorting order of the items displayed"),
-                                                         GTK_TYPE_RECENT_SORT_TYPE,
-                                                         GTK_RECENT_SORT_NONE,
-                                                         GTK_PARAM_READWRITE));
+                                       g_param_spec_enum ("sort-type",
+                                                          P_("Sort Type"),
+                                                          P_("The sorting order of the items displayed"),
+                                                          GTK_TYPE_RECENT_SORT_TYPE,
+                                                          GTK_RECENT_SORT_NONE,
+                                                          GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+
   /**
    * GtkRecentChooser:filter:
    *
@@ -255,11 +262,11 @@ gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
    * Since: 2.10
    */
   g_object_interface_install_property (iface,
-                                      g_param_spec_object ("filter",
-                                                           P_("Filter"),
-                                                           P_("The current filter for selecting which 
resources are displayed"),
-                                                           GTK_TYPE_RECENT_FILTER,
-                                                           GTK_PARAM_READWRITE));
+                                       g_param_spec_object ("filter",
+                                                            P_("Filter"),
+                                                            P_("The current filter for selecting which 
resources are displayed"),
+                                                            GTK_TYPE_RECENT_FILTER,
+                                                            GTK_PARAM_READWRITE));
 }
 
 GQuark


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