[seahorse] Add dummy "label"-property setters to conform SeahorsePlace interface



commit b31e32fe145a6599096cebf9fba93d86090c6d90
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Sep 2 15:48:49 2017 +0200

    Add dummy "label"-property setters to conform SeahorsePlace interface
    
    GLib-GObject-CRITICAL **: g_object_class_install_property: assertion
        'class->set_property != NULL' failed
    GLib-GObject-CRITICAL **: Object class SeahorseGpgmeKeyring doesn't
        implement property 'label' from interface 'SeahorsePlace'
    
    Regression of 7f64db1151ef95cdf2316c5ed34459d3076685d3
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785849

 pgp/seahorse-gpgme-keyring.c  |   25 +++++++++++++++++++++++++
 pgp/seahorse-server-source.c  |   11 ++++++++++-
 pgp/seahorse-unknown-source.c |   25 +++++++++++++++++++++++++
 ssh/seahorse-ssh-source.c     |   25 +++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 1 deletions(-)
---
diff --git a/pgp/seahorse-gpgme-keyring.c b/pgp/seahorse-gpgme-keyring.c
index a5421da..73a2ed2 100644
--- a/pgp/seahorse-gpgme-keyring.c
+++ b/pgp/seahorse-gpgme-keyring.c
@@ -806,6 +806,11 @@ seahorse_gpgme_keyring_get_label (SeahorsePlace *place)
        return g_strdup (_("GnuPG keys"));
 }
 
+static void
+seahorse_gpgme_keyring_set_label (SeahorsePlace *place, const char *label)
+{
+}
+
 static gchar *
 seahorse_gpgme_keyring_get_description (SeahorsePlace *place)
 {
@@ -864,6 +869,24 @@ seahorse_gpgme_keyring_get_property (GObject *obj,
 }
 
 static void
+seahorse_gpgme_keyring_set_property (GObject *obj,
+                                     guint prop_id,
+                                     const GValue *value,
+                                     GParamSpec *pspec)
+{
+       SeahorsePlace *place = SEAHORSE_PLACE (obj);
+
+       switch (prop_id) {
+       case PROP_LABEL:
+               seahorse_gpgme_keyring_set_label (place, g_value_get_boxed (value));
+               break;
+       default:
+               G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+               break;
+       }
+}
+
+static void
 seahorse_gpgme_keyring_dispose (GObject *object)
 {
        SeahorseGpgmeKeyring *self = SEAHORSE_GPGME_KEYRING (object);
@@ -916,6 +939,7 @@ seahorse_gpgme_keyring_class_init (SeahorseGpgmeKeyringClass *klass)
 
        gobject_class = G_OBJECT_CLASS (klass);
        gobject_class->get_property = seahorse_gpgme_keyring_get_property;
+       gobject_class->set_property = seahorse_gpgme_keyring_set_property;
        gobject_class->dispose = seahorse_gpgme_keyring_dispose;
        gobject_class->finalize = seahorse_gpgme_keyring_finalize;
 
@@ -937,6 +961,7 @@ seahorse_gpgme_keyring_place_iface (SeahorsePlaceIface *iface)
        iface->get_description = seahorse_gpgme_keyring_get_description;
        iface->get_icon = seahorse_gpgme_keyring_get_icon;
        iface->get_label = seahorse_gpgme_keyring_get_label;
+       iface->set_label = seahorse_gpgme_keyring_set_label;
        iface->get_uri = seahorse_gpgme_keyring_get_uri;
 }
 
diff --git a/pgp/seahorse-server-source.c b/pgp/seahorse-server-source.c
index f25a270..9619d47 100644
--- a/pgp/seahorse-server-source.c
+++ b/pgp/seahorse-server-source.c
@@ -96,7 +96,7 @@ seahorse_server_source_class_init (SeahorseServerSourceClass *klass)
 
     /* These properties are used to conform to SeahorseSource, but are not actually used */
     g_object_class_install_property (gobject_class, PROP_LABEL,
-            g_param_spec_string ("label", "Label", "Label", "", G_PARAM_READABLE));
+            g_param_spec_string ("label", "Label", "Label", "", G_PARAM_READWRITE));
     g_object_class_install_property (gobject_class, PROP_DESCRIPTION,
             g_param_spec_string ("description", "Description", "Description", "", G_PARAM_READABLE));
     g_object_class_install_property (gobject_class, PROP_ICON,
@@ -174,6 +174,11 @@ seahorse_server_source_get_label (SeahorsePlace* self)
        return g_strdup (SEAHORSE_SERVER_SOURCE (self)->priv->server);
 }
 
+static void
+seahorse_server_source_set_label (SeahorsePlace *self, const char *label)
+{
+}
+
 static gchar *
 seahorse_server_source_get_description (SeahorsePlace* self)
 {
@@ -207,6 +212,7 @@ seahorse_server_source_place_iface (SeahorsePlaceIface *iface)
        iface->get_description = seahorse_server_source_get_description;
        iface->get_icon = seahorse_server_source_get_icon;
        iface->get_label = seahorse_server_source_get_label;
+       iface->set_label = seahorse_server_source_set_label;
        iface->get_uri = seahorse_server_source_get_uri;
 }
 
@@ -227,6 +233,9 @@ seahorse_server_set_property (GObject *object, guint prop_id,
     SeahorseServerSource *ssrc = SEAHORSE_SERVER_SOURCE (object);
  
     switch (prop_id) {
+       case PROP_LABEL:
+               seahorse_server_source_set_label (ssrc, g_value_get_boxed (value));
+               break;
     case PROP_KEY_SERVER:
         g_assert (ssrc->priv->server == NULL);
         ssrc->priv->server = g_strdup (g_value_get_string (value));
diff --git a/pgp/seahorse-unknown-source.c b/pgp/seahorse-unknown-source.c
index 8f4e694..5a21e2b 100644
--- a/pgp/seahorse-unknown-source.c
+++ b/pgp/seahorse-unknown-source.c
@@ -89,6 +89,11 @@ seahorse_unknown_source_get_label (SeahorsePlace* self)
        return g_strdup ("");
 }
 
+static void
+seahorse_unknown_source_set_label (SeahorsePlace *self, const char *label)
+{
+}
+
 static gchar *
 seahorse_unknown_source_get_description (SeahorsePlace* self)
 {
@@ -144,6 +149,24 @@ seahorse_unknown_source_get_property (GObject *obj,
 }
 
 static void
+seahorse_unknown_source_set_property (GObject *obj,
+                                      guint prop_id,
+                                      const GValue *value,
+                                      GParamSpec *pspec)
+{
+       SeahorsePlace *place = SEAHORSE_PLACE (obj);
+
+       switch (prop_id) {
+       case PROP_LABEL:
+               seahorse_unknown_source_set_label (place, g_value_get_boxed (value));
+               break;
+       default:
+               G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+               break;
+       }
+}
+
+static void
 seahorse_unknown_source_finalize (GObject *obj)
 {
        SeahorseUnknownSource *self = SEAHORSE_UNKNOWN_SOURCE (obj);
@@ -159,6 +182,7 @@ seahorse_unknown_source_class_init (SeahorseUnknownSourceClass *klass)
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
        gobject_class->get_property = seahorse_unknown_source_get_property;
+       gobject_class->set_property = seahorse_unknown_source_set_property;
        gobject_class->finalize = seahorse_unknown_source_finalize;
 
        g_object_class_override_property (gobject_class, PROP_LABEL, "label");
@@ -208,6 +232,7 @@ seahorse_unknown_source_place_iface (SeahorsePlaceIface *iface)
        iface->get_description = seahorse_unknown_source_get_description;
        iface->get_icon = seahorse_unknown_source_get_icon;
        iface->get_label = seahorse_unknown_source_get_label;
+       iface->set_label = seahorse_unknown_source_set_label;
        iface->get_uri = seahorse_unknown_source_get_uri;
 }
 
diff --git a/ssh/seahorse-ssh-source.c b/ssh/seahorse-ssh-source.c
index a4f342d..0002db5 100644
--- a/ssh/seahorse-ssh-source.c
+++ b/ssh/seahorse-ssh-source.c
@@ -219,6 +219,11 @@ seahorse_ssh_source_get_label (SeahorsePlace *place)
        return g_strdup (_("OpenSSH keys"));
 }
 
+static void
+seahorse_ssh_source_set_label (SeahorsePlace *place, const char *label)
+{
+}
+
 static gchar *
 seahorse_ssh_source_get_description (SeahorsePlace *place)
 {
@@ -280,6 +285,24 @@ seahorse_ssh_source_get_property (GObject *obj,
 }
 
 static void
+seahorse_ssh_source_set_property (GObject *obj,
+                                  guint prop_id,
+                                  const GValue *value,
+                                  GParamSpec *pspec)
+{
+       SeahorsePlace *place = SEAHORSE_PLACE (obj);
+
+       switch (prop_id) {
+       case PROP_LABEL:
+               seahorse_ssh_source_set_label (place, g_value_get_boxed (value));
+               break;
+       default:
+               G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
+               break;
+       }
+}
+
+static void
 seahorse_ssh_source_dispose (GObject *gobject)
 {
        SeahorseSSHSource *ssrc = SEAHORSE_SSH_SOURCE (gobject);
@@ -360,6 +383,7 @@ seahorse_ssh_source_class_init (SeahorseSSHSourceClass *klass)
     gobject_class->dispose = seahorse_ssh_source_dispose;
     gobject_class->finalize = seahorse_ssh_source_finalize;
     gobject_class->get_property = seahorse_ssh_source_get_property;
+    gobject_class->set_property = seahorse_ssh_source_set_property;
 
     g_object_class_override_property (gobject_class, PROP_LABEL, "label");
     g_object_class_override_property (gobject_class, PROP_DESCRIPTION, "description");
@@ -862,6 +886,7 @@ seahorse_ssh_source_place_iface (SeahorsePlaceIface *iface)
        iface->get_description = seahorse_ssh_source_get_description;
        iface->get_icon = seahorse_ssh_source_get_icon;
        iface->get_label = seahorse_ssh_source_get_label;
+       iface->set_label = seahorse_ssh_source_set_label;
        iface->get_uri = seahorse_ssh_source_get_uri;
 }
 


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