[gnome-user-share] share-bar: make the label property write only



commit c307a0196399f0ff29be4a7a4fad0a6c43a22e1b
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon May 21 14:57:21 2012 -0400

    share-bar: make the label property write only
    
    Since that's all it's needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676515

 src/nautilus-share-bar.c |   33 ++++++---------------------------
 1 files changed, 6 insertions(+), 27 deletions(-)
---
diff --git a/src/nautilus-share-bar.c b/src/nautilus-share-bar.c
index cee05d2..0d663ed 100644
--- a/src/nautilus-share-bar.c
+++ b/src/nautilus-share-bar.c
@@ -32,7 +32,6 @@
 struct NautilusShareBarPrivate
 {
         GtkWidget   *label;
-        char        *str;
 };
 
 enum {
@@ -55,10 +54,9 @@ nautilus_share_bar_set_property (GObject            *object,
         switch (prop_id) {
 	case PROP_LABEL: {
 		char *str;
-		g_free (self->priv->str);
 		str = g_strdup_printf ("<i>%s</i>", g_value_get_string (value));
 		gtk_label_set_markup (GTK_LABEL (self->priv->label), str);
-		self->priv->str = g_value_dup_string (value);
+                g_free (str);
 		break;
 	}
         default:
@@ -68,38 +66,19 @@ nautilus_share_bar_set_property (GObject            *object,
 }
 
 static void
-nautilus_share_bar_get_property (GObject    *object,
-                                guint       prop_id,
-                                GValue     *value,
-                                GParamSpec *pspec)
-{
-        NautilusShareBar *self;
-
-        self = NAUTILUS_SHARE_BAR (object);
-
-        switch (prop_id) {
-	case PROP_LABEL:
-		g_value_set_string (value, self->priv->str);
-		break;
-        default:
-                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-                break;
-        }
-}
-
-static void
 nautilus_share_bar_class_init (NautilusShareBarClass *klass)
 {
         GObjectClass   *object_class = G_OBJECT_CLASS (klass);
 
-        object_class->get_property = nautilus_share_bar_get_property;
         object_class->set_property = nautilus_share_bar_set_property;
 
         g_type_class_add_private (klass, sizeof (NautilusShareBarPrivate));
 
-        g_object_class_install_property (G_OBJECT_CLASS(klass),
-					 PROP_LABEL, g_param_spec_string ("label",
-									  "label", "The widget's main label", NULL, G_PARAM_READWRITE));
+        g_object_class_install_property (G_OBJECT_CLASS(klass), PROP_LABEL,
+                                         g_param_spec_string ("label", "label", 
+                                                              "The widget's main label",
+                                                              NULL, 
+                                                              G_PARAM_WRITABLE));
 }
 
 static void



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