[seahorse/wip/nielsdg/remove-more-deprecated: 2/8] gpgme: Subkey: Don't use g_type_class_add_private()



commit ffbac5d799a562ee9022bec889597a9d10ae02f4
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Feb 19 05:29:17 2019 +0100

    gpgme: Subkey: Don't use g_type_class_add_private()
    
    It's been deprecated a while now in favor of `G_ADD_PRIVATE ()`

 pgp/seahorse-gpgme-expires.c      |   2 +-
 pgp/seahorse-gpgme-key-op.c       |   6 +-
 pgp/seahorse-gpgme-revoke.c       |   4 +-
 pgp/seahorse-gpgme-subkey.c       | 334 ++++++++++++++++++--------------------
 pgp/seahorse-gpgme-subkey.h       |  25 +--
 pgp/seahorse-pgp-key-properties.c |   6 +-
 6 files changed, 174 insertions(+), 203 deletions(-)
---
diff --git a/pgp/seahorse-gpgme-expires.c b/pgp/seahorse-gpgme-expires.c
index 0b293c4d..6cdb1d1f 100644
--- a/pgp/seahorse-gpgme-expires.c
+++ b/pgp/seahorse-gpgme-expires.c
@@ -105,7 +105,7 @@ seahorse_gpgme_expires_new (SeahorseGpgmeSubkey *subkey, GtkWindow *parent)
        gchar *title;
        const gchar *label;
        
-       g_return_if_fail (subkey != NULL && SEAHORSE_IS_GPGME_SUBKEY (subkey));
+       g_return_if_fail (subkey != NULL && SEAHORSE_GPGME_IS_SUBKEY (subkey));
 
        swidget = seahorse_widget_new_allow_multiple ("expires", parent);
        g_return_if_fail (swidget != NULL);
diff --git a/pgp/seahorse-gpgme-key-op.c b/pgp/seahorse-gpgme-key-op.c
index da39d02e..4d2f381b 100644
--- a/pgp/seahorse-gpgme-key-op.c
+++ b/pgp/seahorse-gpgme-key-op.c
@@ -1100,7 +1100,7 @@ seahorse_gpgme_key_op_set_expires (SeahorseGpgmeSubkey *subkey, const time_t exp
        SeahorseEditParm *parms;
        gpgme_key_t key;
        
-       g_return_val_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+       g_return_val_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
        g_return_val_if_fail (expires != (time_t)seahorse_pgp_subkey_get_expires (SEAHORSE_PGP_SUBKEY 
(subkey)), GPG_E (GPG_ERR_INV_VALUE));
        
        key = seahorse_gpgme_subkey_get_pubkey (subkey);
@@ -1581,7 +1581,7 @@ seahorse_gpgme_key_op_del_subkey (SeahorseGpgmeSubkey *subkey)
        gpgme_key_t key;
        int index;
        
-       g_return_val_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+       g_return_val_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
        
        key = seahorse_gpgme_subkey_get_pubkey (subkey);
        g_return_val_if_fail (key, GPG_E (GPG_ERR_INV_VALUE));
@@ -1759,7 +1759,7 @@ seahorse_gpgme_key_op_revoke_subkey (SeahorseGpgmeSubkey *subkey, SeahorseRevoke
        gpgme_subkey_t gsubkey;
        gpgme_key_t key;
        
-       g_return_val_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
+       g_return_val_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
        
        gsubkey = seahorse_gpgme_subkey_get_subkey (subkey);
        g_return_val_if_fail (!gsubkey->revoked, GPG_E (GPG_ERR_INV_VALUE));
diff --git a/pgp/seahorse-gpgme-revoke.c b/pgp/seahorse-gpgme-revoke.c
index 5a286d1c..fd6f48da 100644
--- a/pgp/seahorse-gpgme-revoke.c
+++ b/pgp/seahorse-gpgme-revoke.c
@@ -66,7 +66,7 @@ on_gpgme_revoke_ok_clicked (GtkButton *button,
        
        description = gtk_entry_get_text (GTK_ENTRY (seahorse_widget_get_widget (swidget, "description")));
        subkey = g_object_get_data (G_OBJECT (swidget), "subkey");
-       g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey));
+       g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey));
        
        err = seahorse_gpgme_key_op_revoke_subkey (subkey, reason, description);
        if (!GPG_IS_OK (err))
@@ -85,7 +85,7 @@ seahorse_gpgme_revoke_new (SeahorseGpgmeSubkey *subkey, GtkWindow *parent)
        GtkTreeIter iter;
        GtkCellRenderer *renderer;
        
-       g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey));
+       g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey));
        
        swidget = seahorse_widget_new ("revoke", parent);
        g_return_if_fail (swidget != NULL);
diff --git a/pgp/seahorse-gpgme-subkey.c b/pgp/seahorse-gpgme-subkey.c
index 1115a031..6901ce66 100644
--- a/pgp/seahorse-gpgme-subkey.c
+++ b/pgp/seahorse-gpgme-subkey.c
@@ -28,218 +28,206 @@
 #include <glib/gi18n.h>
 
 enum {
-       PROP_0,
-       PROP_PUBKEY,
-       PROP_SUBKEY
+    PROP_0,
+    PROP_PUBKEY,
+    PROP_SUBKEY
 };
 
-G_DEFINE_TYPE (SeahorseGpgmeSubkey, seahorse_gpgme_subkey, SEAHORSE_PGP_TYPE_SUBKEY);
+struct _SeahorseGpgmeSubkey {
+    SeahorsePgpSubkey parent_instance;
 
-struct _SeahorseGpgmeSubkeyPrivate {
-       gpgme_key_t pubkey;         /* The public key that this subkey is part of */
-       gpgme_subkey_t subkey;      /* The subkey referred to */
+    gpgme_key_t pubkey;         /* The public key that this subkey is part of */
+    gpgme_subkey_t subkey;      /* The subkey referred to */
 };
 
-/* -----------------------------------------------------------------------------
- * OBJECT 
- */
+G_DEFINE_TYPE (SeahorseGpgmeSubkey, seahorse_gpgme_subkey, SEAHORSE_PGP_TYPE_SUBKEY);
+
+
+gpgme_key_t
+seahorse_gpgme_subkey_get_pubkey (SeahorseGpgmeSubkey *self)
+{
+    g_return_val_if_fail (SEAHORSE_GPGME_IS_SUBKEY (self), NULL);
+    g_return_val_if_fail (self->pubkey, NULL);
+    return self->pubkey;
+}
+
+gpgme_subkey_t
+seahorse_gpgme_subkey_get_subkey (SeahorseGpgmeSubkey *self)
+{
+    g_return_val_if_fail (SEAHORSE_GPGME_IS_SUBKEY (self), NULL);
+    g_return_val_if_fail (self->subkey, NULL);
+    return self->subkey;
+}
+
+void
+seahorse_gpgme_subkey_set_subkey (SeahorseGpgmeSubkey *self, gpgme_subkey_t subkey)
+{
+    g_autofree gchar *description = NULL, *fingerprint = NULL, *name = NULL;
+    SeahorsePgpSubkey *base;
+    const gchar *algo_type;
+    GObject *obj;
+    gpgme_subkey_t sub;
+    gint i, index;
+    guint flags;
+
+    g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (self));
+    g_return_if_fail (subkey);
+
+    /* Make sure that this subkey is in the pubkey */
+    index = -1;
+    for (i = 0, sub = self->pubkey->subkeys; sub; ++i, sub = sub->next) {
+        if (sub == subkey) {
+            index = i;
+            break;
+        }
+    }
+    g_return_if_fail (index >= 0);
+
+    /* Calculate the algorithm */
+    algo_type = gpgme_pubkey_algo_name (subkey->pubkey_algo);
+    if (algo_type == NULL)
+        algo_type = C_("Algorithm", "Unknown");
+    else if (g_str_equal ("Elg", algo_type) || g_str_equal("ELG-E", algo_type))
+        algo_type = _("ElGamal");
+
+    /* Additional properties */
+    fingerprint = seahorse_pgp_subkey_calc_fingerprint (subkey->fpr);
+    name = seahorse_gpgme_uid_calc_name (self->pubkey->uids);
+    description = seahorse_pgp_subkey_calc_description (name, index);
+
+    self->subkey = subkey;
+
+    obj = G_OBJECT (self);
+    g_object_freeze_notify (obj);
+
+    base = SEAHORSE_PGP_SUBKEY (self);
+    seahorse_pgp_subkey_set_index (base, index);
+    seahorse_pgp_subkey_set_keyid (base, subkey->keyid);
+    seahorse_pgp_subkey_set_algorithm (base, algo_type);
+    seahorse_pgp_subkey_set_length (base, subkey->length);
+    seahorse_pgp_subkey_set_description (base, description);
+    seahorse_pgp_subkey_set_fingerprint (base, fingerprint);
+    seahorse_pgp_subkey_set_created (base, subkey->timestamp);
+    seahorse_pgp_subkey_set_expires (base, subkey->expires);
+
+    /* The order below is significant */
+    flags = 0;
+    if (subkey->revoked)
+        flags |= SEAHORSE_FLAG_REVOKED;
+    if (subkey->expired)
+        flags |= SEAHORSE_FLAG_EXPIRED;
+    if (subkey->disabled)
+        flags |= SEAHORSE_FLAG_DISABLED;
+    if (flags == 0 && !subkey->invalid)
+        flags |= SEAHORSE_FLAG_IS_VALID;
+    if (subkey->can_encrypt)
+        flags |= SEAHORSE_FLAG_CAN_ENCRYPT;
+    if (subkey->can_sign)
+        flags |= SEAHORSE_FLAG_CAN_SIGN;
+    if (subkey->can_certify)
+        flags |= SEAHORSE_FLAG_CAN_CERTIFY;
+    if (subkey->can_authenticate)
+        flags |= SEAHORSE_FLAG_CAN_AUTHENTICATE;
+
+    seahorse_pgp_subkey_set_flags (base, flags);
+
+    g_object_notify (obj, "subkey");
+    g_object_thaw_notify (obj);
+}
 
 static void
 seahorse_gpgme_subkey_init (SeahorseGpgmeSubkey *self)
 {
-       self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SEAHORSE_TYPE_GPGME_SUBKEY, SeahorseGpgmeSubkeyPrivate);
 }
 
 static GObject*
 seahorse_gpgme_subkey_constructor (GType type, guint n_props, GObjectConstructParam *props)
 {
-       GObject *obj = G_OBJECT_CLASS (seahorse_gpgme_subkey_parent_class)->constructor (type, n_props, 
props);
-       SeahorseGpgmeSubkey *self = NULL;
-       
-       if (obj) {
-               self = SEAHORSE_GPGME_SUBKEY (obj);
-               g_return_val_if_fail (self->pv->pubkey, NULL);
-       }
-       
-       return obj;
+    GObject *obj;
+    SeahorseGpgmeSubkey *self = NULL;
+
+    obj = G_OBJECT_CLASS (seahorse_gpgme_subkey_parent_class)->constructor (type, n_props, props);
+    if (obj) {
+        self = SEAHORSE_GPGME_SUBKEY (obj);
+        g_return_val_if_fail (self->pubkey, NULL);
+    }
+
+    return obj;
 }
 
 static void
 seahorse_gpgme_subkey_get_property (GObject *object, guint prop_id,
                                   GValue *value, GParamSpec *pspec)
 {
-       SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (object);
-       
-       switch (prop_id) {
-       case PROP_PUBKEY:
-               g_value_set_boxed (value, seahorse_gpgme_subkey_get_pubkey (self));
-               break;
-       case PROP_SUBKEY:
-               g_value_set_pointer (value, seahorse_gpgme_subkey_get_subkey (self));
-               break;
-       }
+    SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (object);
+
+    switch (prop_id) {
+    case PROP_PUBKEY:
+        g_value_set_boxed (value, seahorse_gpgme_subkey_get_pubkey (self));
+        break;
+    case PROP_SUBKEY:
+        g_value_set_pointer (value, seahorse_gpgme_subkey_get_subkey (self));
+        break;
+    }
 }
 
 static void
-seahorse_gpgme_subkey_set_property (GObject *object, guint prop_id, const GValue *value, 
+seahorse_gpgme_subkey_set_property (GObject *object, guint prop_id, const GValue *value,
                                   GParamSpec *pspec)
 {
-       SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (object);
-
-       switch (prop_id) {
-       case PROP_PUBKEY:
-               g_return_if_fail (!self->pv->pubkey);
-               self->pv->pubkey = g_value_get_boxed (value);
-               if (self->pv->pubkey)
-                       gpgme_key_ref (self->pv->pubkey);
-               break;
-       case PROP_SUBKEY:
-               seahorse_gpgme_subkey_set_subkey (self, g_value_get_pointer (value));
-               break;
-       }
+    SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (object);
+
+    switch (prop_id) {
+    case PROP_PUBKEY:
+        g_return_if_fail (!self->pubkey);
+        self->pubkey = g_value_get_boxed (value);
+        if (self->pubkey)
+            gpgme_key_ref (self->pubkey);
+        break;
+    case PROP_SUBKEY:
+        seahorse_gpgme_subkey_set_subkey (self, g_value_get_pointer (value));
+        break;
+    }
 }
 
 static void
 seahorse_gpgme_subkey_finalize (GObject *gobject)
 {
-       SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (gobject);
-
-       /* Unref the key */
-       if (self->pv->pubkey)
-               gpgme_key_unref (self->pv->pubkey);
-       self->pv->pubkey = NULL;
-       self->pv->subkey = NULL;
-    
-       G_OBJECT_CLASS (seahorse_gpgme_subkey_parent_class)->finalize (gobject);
+    SeahorseGpgmeSubkey *self = SEAHORSE_GPGME_SUBKEY (gobject);
+
+    /* Unref the key */
+    if (self->pubkey)
+        gpgme_key_unref (self->pubkey);
+    self->pubkey = NULL;
+    self->subkey = NULL;
+
+    G_OBJECT_CLASS (seahorse_gpgme_subkey_parent_class)->finalize (gobject);
 }
 
 static void
 seahorse_gpgme_subkey_class_init (SeahorseGpgmeSubkeyClass *klass)
 {
-       GObjectClass *gobject_class = G_OBJECT_CLASS (klass);    
-
-       seahorse_gpgme_subkey_parent_class = g_type_class_peek_parent (klass);
-       g_type_class_add_private (klass, sizeof (SeahorseGpgmeSubkeyPrivate));
-
-       gobject_class->constructor = seahorse_gpgme_subkey_constructor;
-       gobject_class->finalize = seahorse_gpgme_subkey_finalize;
-       gobject_class->set_property = seahorse_gpgme_subkey_set_property;
-       gobject_class->get_property = seahorse_gpgme_subkey_get_property;
-    
-       g_object_class_install_property (gobject_class, PROP_PUBKEY,
-               g_param_spec_boxed ("pubkey", "Public Key", "GPGME Public Key that this subkey is on",
-                                   SEAHORSE_GPGME_BOXED_KEY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_object_class_install_property (gobject_class, PROP_SUBKEY,
-               g_param_spec_pointer ("subkey", "Subkey", "GPGME Subkey",
-                                     G_PARAM_READWRITE));
-}
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-/* -----------------------------------------------------------------------------
- * PUBLIC 
- */
+    gobject_class->constructor = seahorse_gpgme_subkey_constructor;
+    gobject_class->finalize = seahorse_gpgme_subkey_finalize;
+    gobject_class->set_property = seahorse_gpgme_subkey_set_property;
+    gobject_class->get_property = seahorse_gpgme_subkey_get_property;
 
-SeahorseGpgmeSubkey* 
-seahorse_gpgme_subkey_new (gpgme_key_t pubkey, gpgme_subkey_t subkey) 
-{
-       return g_object_new (SEAHORSE_TYPE_GPGME_SUBKEY, 
-                            "pubkey", pubkey, 
-                            "subkey", subkey, NULL);
-}
+    g_object_class_install_property (gobject_class, PROP_PUBKEY,
+        g_param_spec_boxed ("pubkey", "Public Key", "GPGME Public Key that this subkey is on",
+                            SEAHORSE_GPGME_BOXED_KEY,
+                            G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY));
 
-
-gpgme_key_t
-seahorse_gpgme_subkey_get_pubkey (SeahorseGpgmeSubkey *self)
-{
-       g_return_val_if_fail (SEAHORSE_IS_GPGME_SUBKEY (self), NULL);
-       g_return_val_if_fail (self->pv->pubkey, NULL);
-       return self->pv->pubkey;
+    g_object_class_install_property (gobject_class, PROP_SUBKEY,
+        g_param_spec_pointer ("subkey", "Subkey", "GPGME Subkey",
+                              G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 }
 
-gpgme_subkey_t
-seahorse_gpgme_subkey_get_subkey (SeahorseGpgmeSubkey *self)
-{
-       g_return_val_if_fail (SEAHORSE_IS_GPGME_SUBKEY (self), NULL);
-       g_return_val_if_fail (self->pv->subkey, NULL);
-       return self->pv->subkey;
-}
-
-void
-seahorse_gpgme_subkey_set_subkey (SeahorseGpgmeSubkey *self, gpgme_subkey_t subkey)
+SeahorseGpgmeSubkey*
+seahorse_gpgme_subkey_new (gpgme_key_t pubkey, gpgme_subkey_t subkey)
 {
-       gchar *description, *fingerprint, *name;
-       SeahorsePgpSubkey *base;
-       const gchar *algo_type;
-       GObject *obj;
-       gpgme_subkey_t sub;
-       gint i, index;
-       guint flags;
-       
-       g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (self));
-       g_return_if_fail (subkey);
-       
-       /* Make sure that this subkey is in the pubkey */
-       index = -1;
-       for (i = 0, sub = self->pv->pubkey->subkeys; sub; ++i, sub = sub->next) {
-               if(sub == subkey) {
-                       index = i;
-                       break;
-               }
-       }
-       g_return_if_fail (index >= 0);
-       
-       /* Calculate the algorithm */
-       algo_type = gpgme_pubkey_algo_name (subkey->pubkey_algo);
-       if (algo_type == NULL)
-               algo_type = C_("Algorithm", "Unknown");
-       else if (g_str_equal ("Elg", algo_type) || g_str_equal("ELG-E", algo_type))
-               algo_type = _("ElGamal");
-
-       /* Additional properties */
-       fingerprint = seahorse_pgp_subkey_calc_fingerprint (subkey->fpr);
-       name = seahorse_gpgme_uid_calc_name (self->pv->pubkey->uids);
-       description = seahorse_pgp_subkey_calc_description (name, index);
-       
-       self->pv->subkey = subkey;
-       
-       obj = G_OBJECT (self);
-       g_object_freeze_notify (obj);
-       
-       base = SEAHORSE_PGP_SUBKEY (self);
-       seahorse_pgp_subkey_set_index (base, index);
-       seahorse_pgp_subkey_set_keyid (base, subkey->keyid);
-       seahorse_pgp_subkey_set_algorithm (base, algo_type);
-       seahorse_pgp_subkey_set_length (base, subkey->length);
-       seahorse_pgp_subkey_set_description (base, description);
-       seahorse_pgp_subkey_set_fingerprint (base, fingerprint);
-       seahorse_pgp_subkey_set_created (base, subkey->timestamp);
-       seahorse_pgp_subkey_set_expires (base, subkey->expires);
-       
-       /* The order below is significant */
-       flags = 0;
-       if (subkey->revoked)
-               flags |= SEAHORSE_FLAG_REVOKED;
-       if (subkey->expired)
-               flags |= SEAHORSE_FLAG_EXPIRED;
-       if (subkey->disabled)
-               flags |= SEAHORSE_FLAG_DISABLED;
-       if (flags == 0 && !subkey->invalid)
-               flags |= SEAHORSE_FLAG_IS_VALID;
-       if (subkey->can_encrypt)
-               flags |= SEAHORSE_FLAG_CAN_ENCRYPT;
-       if (subkey->can_sign)
-               flags |= SEAHORSE_FLAG_CAN_SIGN;
-       if (subkey->can_certify)
-               flags |= SEAHORSE_FLAG_CAN_CERTIFY;
-       if (subkey->can_authenticate)
-               flags |= SEAHORSE_FLAG_CAN_AUTHENTICATE;
-       
-       seahorse_pgp_subkey_set_flags (base, flags);
-       
-       g_object_notify (obj, "subkey");
-       g_object_thaw_notify (obj);
-       
-       g_free (description);
-       g_free (name);
-       g_free (fingerprint);
+    return g_object_new (SEAHORSE_GPGME_TYPE_SUBKEY,
+                         "pubkey", pubkey,
+                         "subkey", subkey, NULL);
 }
diff --git a/pgp/seahorse-gpgme-subkey.h b/pgp/seahorse-gpgme-subkey.h
index 5bd4e447..248a269d 100644
--- a/pgp/seahorse-gpgme-subkey.h
+++ b/pgp/seahorse-gpgme-subkey.h
@@ -25,27 +25,10 @@
 
 #include "pgp/seahorse-pgp-subkey.h"
 
-#define SEAHORSE_TYPE_GPGME_SUBKEY            (seahorse_gpgme_subkey_get_type ())
-#define SEAHORSE_GPGME_SUBKEY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
SEAHORSE_TYPE_GPGME_SUBKEY, SeahorseGpgmeSubkey))
-#define SEAHORSE_GPGME_SUBKEY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_GPGME_SUBKEY, 
SeahorseGpgmeSubkeyClass))
-#define SEAHORSE_IS_GPGME_SUBKEY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
SEAHORSE_TYPE_GPGME_SUBKEY))
-#define SEAHORSE_IS_GPGME_SUBKEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_GPGME_SUBKEY))
-#define SEAHORSE_GPGME_SUBKEY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_GPGME_SUBKEY, 
SeahorseGpgmeSubkeyClass))
-
-typedef struct _SeahorseGpgmeSubkey SeahorseGpgmeSubkey;
-typedef struct _SeahorseGpgmeSubkeyClass SeahorseGpgmeSubkeyClass;
-typedef struct _SeahorseGpgmeSubkeyPrivate SeahorseGpgmeSubkeyPrivate;
-
-struct _SeahorseGpgmeSubkey {
-       SeahorsePgpSubkey parent;
-       SeahorseGpgmeSubkeyPrivate *pv;
-};
-
-struct _SeahorseGpgmeSubkeyClass {
-       SeahorsePgpSubkeyClass parent_class;
-};
-
-GType                 seahorse_gpgme_subkey_get_type          (void);
+#define SEAHORSE_GPGME_TYPE_SUBKEY (seahorse_gpgme_subkey_get_type ())
+G_DECLARE_FINAL_TYPE (SeahorseGpgmeSubkey, seahorse_gpgme_subkey,
+                      SEAHORSE_GPGME, SUBKEY,
+                      SeahorsePgpSubkey)
 
 SeahorseGpgmeSubkey*  seahorse_gpgme_subkey_new               (gpgme_key_t pubkey,
                                                                gpgme_subkey_t subkey);
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index 325f3e4f..be32b271 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -944,7 +944,7 @@ on_subkeys_delete (GSimpleAction *action, GVariant *param, gpointer user_data)
     if (!subkey)
         return;
 
-    g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey));
+    g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey));
 
     index = seahorse_pgp_subkey_get_index (subkey);
     label = seahorse_object_get_label (SEAHORSE_OBJECT (self->key));
@@ -967,7 +967,7 @@ on_subkeys_revoke (GSimpleAction *action, GVariant *param, gpointer user_data)
     if (subkey != NULL)
         return;
 
-    g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey));
+    g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey));
     seahorse_gpgme_revoke_new (SEAHORSE_GPGME_SUBKEY (subkey),
                                GTK_WINDOW (self));
 }
@@ -986,7 +986,7 @@ on_subkeys_change_expires (GSimpleAction *action, GVariant *param, gpointer user
             subkey = subkeys->data;
     }
 
-    g_return_if_fail (SEAHORSE_IS_GPGME_SUBKEY (subkey));
+    g_return_if_fail (SEAHORSE_GPGME_IS_SUBKEY (subkey));
 
     if (subkey != NULL)
         seahorse_gpgme_expires_new (SEAHORSE_GPGME_SUBKEY (subkey),


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