[seahorse/wip/nielsdg/pgp-cleanup-backend] pgp: Backend: cleanup with G_DECLARE_FINAL_TYPE



commit 53f9e85cb6ca2fe282c9b6d58a351dd895feaaae
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Jan 5 12:01:48 2019 +0100

    pgp: Backend: cleanup with G_DECLARE_FINAL_TYPE

 pgp/seahorse-pgp-backend.c | 19 ++++++++-----------
 pgp/seahorse-pgp-backend.h | 24 ++++++------------------
 2 files changed, 14 insertions(+), 29 deletions(-)
---
diff --git a/pgp/seahorse-pgp-backend.c b/pgp/seahorse-pgp-backend.c
index 05a90616..fa190cd3 100644
--- a/pgp/seahorse-pgp-backend.c
+++ b/pgp/seahorse-pgp-backend.c
@@ -48,17 +48,14 @@ enum {
 static SeahorsePgpBackend *pgp_backend = NULL;
 
 struct _SeahorsePgpBackend {
-       GObject parent;
-       SeahorseGpgmeKeyring *keyring;
-       SeahorseDiscovery *discovery;
-       SeahorseUnknownSource *unknown;
-       GHashTable *remotes;
-       GtkActionGroup *actions;
-       gboolean loaded;
-};
-
-struct _SeahorsePgpBackendClass {
-       GObjectClass parent_class;
+    GObject parent;
+
+    SeahorseGpgmeKeyring *keyring;
+    SeahorseDiscovery *discovery;
+    SeahorseUnknownSource *unknown;
+    GHashTable *remotes;
+    GtkActionGroup *actions;
+    gboolean loaded;
 };
 
 static void         seahorse_pgp_backend_iface            (SeahorseBackendIface *iface);
diff --git a/pgp/seahorse-pgp-backend.h b/pgp/seahorse-pgp-backend.h
index f1db82cd..d5ac9fda 100644
--- a/pgp/seahorse-pgp-backend.h
+++ b/pgp/seahorse-pgp-backend.h
@@ -20,8 +20,7 @@
  * Author: Stef Walter <stefw collabora co uk>
  */
 
-#ifndef SEAHORSE_PGP_BACKEND_H_
-#define SEAHORSE_PGP_BACKEND_H_
+#pragma once
 
 #include <glib.h>
 #include <glib-object.h>
@@ -35,23 +34,14 @@
 
 G_BEGIN_DECLS
 
-#define SEAHORSE_PGP_NAME "openpgp"
-#define SEAHORSE_PGP_TYPE_STR SEAHORSE_PGP_NAME
-#define SEAHORSE_PGP g_quark_from_string (SEAHORSE_PGP_NAME)
+#define SEAHORSE_PGP_NAME      "openpgp"
+#define SEAHORSE_PGP_TYPE_STR  SEAHORSE_PGP_NAME
+#define SEAHORSE_PGP           g_quark_from_string (SEAHORSE_PGP_NAME)
 
 void       seahorse_pgp_backend_initialize    (void);
 
-#define SEAHORSE_PGP_TYPE_BACKEND            (seahorse_pgp_backend_get_type ())
-#define SEAHORSE_PGP_BACKEND(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_PGP_TYPE_BACKEND, 
SeahorsePgpBackend))
-#define SEAHORSE_PGP_BACKEND_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_PGP_TYPE_BACKEND, 
SeahorsePgpBackendClass))
-#define SEAHORSE_PGP_IS_BACKEND(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_PGP_TYPE_BACKEND))
-#define SEAHORSE_PGP_IS_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_PGP_TYPE_BACKEND))
-#define SEAHORSE_PGP_BACKEND_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_PGP_TYPE_BACKEND, 
SeahorsePgpBackendClass))
-
-typedef struct _SeahorsePgpBackend SeahorsePgpBackend;
-typedef struct _SeahorsePgpBackendClass SeahorsePgpBackendClass;
-
-GType                  seahorse_pgp_backend_get_type             (void) G_GNUC_CONST;
+#define SEAHORSE_PGP_TYPE_BACKEND (seahorse_pgp_backend_get_type ())
+G_DECLARE_FINAL_TYPE (SeahorsePgpBackend, seahorse_pgp_backend, SEAHORSE_PGP, BACKEND, GObject)
 
 SeahorsePgpBackend *   seahorse_pgp_backend_get                  (void);
 
@@ -113,5 +103,3 @@ GList*                 seahorse_pgp_backend_discover_keys        (SeahorsePgpBac
 
 
 G_END_DECLS
-
-#endif /*SEAHORSE_PGP_BACKEND_H_*/


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