[seahorse/wip/nielsdg/g-declare-server-source: 3/3] SeahorseHKPSource: Use G_DECLARE_FINAL_TYPE



commit 029eb51666a09551b6a75c3b011b61abc2c10cd2
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Jan 28 17:12:23 2019 +0100

    SeahorseHKPSource: Use G_DECLARE_FINAL_TYPE

 pgp/seahorse-hkp-source.c |  8 ++++++--
 pgp/seahorse-hkp-source.h | 25 ++++---------------------
 2 files changed, 10 insertions(+), 23 deletions(-)
---
diff --git a/pgp/seahorse-hkp-source.c b/pgp/seahorse-hkp-source.c
index 1982ac84..614bc0f4 100644
--- a/pgp/seahorse-hkp-source.c
+++ b/pgp/seahorse-hkp-source.c
@@ -73,6 +73,12 @@ get_hkp_error_domain (void)
     return q;
 }
 
+struct _SeahorseHKPSource {
+    SeahorseServerSource parent;
+};
+
+G_DEFINE_TYPE (SeahorseHKPSource, seahorse_hkp_source, SEAHORSE_TYPE_SERVER_SOURCE);
+
 /**
 * src: The SeahorseSource to use as server for the uri
 * path: The path to add to the SOUP uri
@@ -526,8 +532,6 @@ detect_key (const gchar *text, gint len, const gchar **start, const gchar **end)
  *  SEAHORSE HKP SOURCE
  */
 
-G_DEFINE_TYPE (SeahorseHKPSource, seahorse_hkp_source, SEAHORSE_TYPE_SERVER_SOURCE);
-
 static void 
 seahorse_hkp_source_init (SeahorseHKPSource *hsrc)
 {
diff --git a/pgp/seahorse-hkp-source.h b/pgp/seahorse-hkp-source.h
index 357e9645..233400bc 100644
--- a/pgp/seahorse-hkp-source.h
+++ b/pgp/seahorse-hkp-source.h
@@ -32,27 +32,10 @@
 
 #ifdef WITH_HKP
 
-#define SEAHORSE_TYPE_HKP_SOURCE            (seahorse_hkp_source_get_type ())
-#define SEAHORSE_HKP_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_HKP_SOURCE, 
SeahorseHKPSource))
-#define SEAHORSE_HKP_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_HKP_SOURCE, 
SeahorseHKPSourceClass))
-#define SEAHORSE_IS_HKP_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_HKP_SOURCE))
-#define SEAHORSE_IS_HKP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_HKP_SOURCE))
-#define SEAHORSE_HKP_SOURCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_HKP_SOURCE, 
SeahorseHKPSourceClass))
-
-typedef struct _SeahorseHKPSource SeahorseHKPSource;
-typedef struct _SeahorseHKPSourceClass SeahorseHKPSourceClass;
-
-struct _SeahorseHKPSource {
-    SeahorseServerSource parent;
-    
-    /*< private >*/
-};
-
-struct _SeahorseHKPSourceClass {
-    SeahorseServerSourceClass parent_class;
-};
-
-GType                 seahorse_hkp_source_get_type (void);
+#define SEAHORSE_TYPE_HKP_SOURCE (seahorse_hkp_source_get_type ())
+G_DECLARE_FINAL_TYPE (SeahorseHKPSource, seahorse_hkp_source,
+                      SEAHORSE, HKP_SOURCE,
+                      SeahorseServerSource)
 
 SeahorseHKPSource*    seahorse_hkp_source_new      (const gchar *uri, 
                                                     const gchar *host);


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