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



commit f603299e1e83a8906ba00959a4478f211db32d4c
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Jan 28 17:09:50 2019 +0100

    SeahorseLdapSource: Use G_DECLARE_FINAL_TYPE

 pgp/seahorse-ldap-source.c |  4 ++++
 pgp/seahorse-ldap-source.h | 33 ++++++++-------------------------
 2 files changed, 12 insertions(+), 25 deletions(-)
---
diff --git a/pgp/seahorse-ldap-source.c b/pgp/seahorse-ldap-source.c
index 41a15cd6..034fcf8d 100644
--- a/pgp/seahorse-ldap-source.c
+++ b/pgp/seahorse-ldap-source.c
@@ -49,6 +49,10 @@
 /* Amount of keys to load in a batch */
 #define DEFAULT_LOAD_BATCH 30
 
+struct _SeahorseLDAPSource {
+    SeahorseServerSource parent;
+};
+
 /* -----------------------------------------------------------------------------
  * SERVER INFO
  */
diff --git a/pgp/seahorse-ldap-source.h b/pgp/seahorse-ldap-source.h
index b3c15923..0fdad48e 100644
--- a/pgp/seahorse-ldap-source.h
+++ b/pgp/seahorse-ldap-source.h
@@ -18,10 +18,10 @@
  */
 
 /**
- * SeahorseHKPSource: A key source which searches LDAP PGP key servers. 
- * 
+ * SeahorseHKPSource: A key source which searches LDAP PGP key servers.
+ *
  * - Derived from SeahorseServerSource.
- * - Adds found keys to SeahorseContext. 
+ * - Adds found keys to SeahorseContext.
  */
 
 #pragma once
@@ -30,29 +30,12 @@
 
 #ifdef WITH_LDAP
 
-#define SEAHORSE_TYPE_LDAP_SOURCE            (seahorse_ldap_source_get_type ())
-#define SEAHORSE_LDAP_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_LDAP_SOURCE, 
SeahorseLDAPSource))
-#define SEAHORSE_LDAP_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_LDAP_SOURCE, 
SeahorseLDAPSourceClass))
-#define SEAHORSE_IS_LDAP_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_LDAP_SOURCE))
-#define SEAHORSE_IS_LDAP_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_LDAP_SOURCE))
-#define SEAHORSE_LDAP_SOURCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_LDAP_SOURCE, 
SeahorseLDAPSourceClass))
-
-typedef struct _SeahorseLDAPSource SeahorseLDAPSource;
-typedef struct _SeahorseLDAPSourceClass SeahorseLDAPSourceClass;
-
-struct _SeahorseLDAPSource {
-    SeahorseServerSource parent;
-
-    /*< private >*/
-};
-
-struct _SeahorseLDAPSourceClass {
-    SeahorseServerSourceClass parent_class;
-};
-
-GType                 seahorse_ldap_source_get_type (void);
+#define SEAHORSE_TYPE_LDAP_SOURCE (seahorse_ldap_source_get_type ())
+G_DECLARE_FINAL_TYPE (SeahorseLDAPSource, seahorse_ldap_source,
+                      SEAHORSE, LDAP_SOURCE,
+                      SeahorseServerSource)
 
-SeahorseLDAPSource*   seahorse_ldap_source_new     (const gchar *uri, 
+SeahorseLDAPSource*   seahorse_ldap_source_new     (const gchar *uri,
                                                     const gchar *host);
 
 gboolean              seahorse_ldap_is_valid_uri   (const gchar *uri);


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