[balsa] Declare LibBalsaAddressBookRubrica final



commit acee7037a0eec592042a520bb2ed688b1a1cc68e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat May 25 22:24:14 2019 -0400

    Declare LibBalsaAddressBookRubrica final
    
    Use G_DECLARE_FINAL_TYPE to declare LibBalsaAddressBookRubrica
    
    Make the structure private; no need for getters and setters.
    
    * libbalsa/address-book-rubrica.c:
    * libbalsa/address-book-rubrica.h:

 ChangeLog                       |  9 +++++++++
 libbalsa/address-book-rubrica.c | 14 +++++++++++++-
 libbalsa/address-book-rubrica.h | 24 ++++--------------------
 3 files changed, 26 insertions(+), 21 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a328c8945..9ed6362af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-05-25  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Use G_DECLARE_FINAL_TYPE to declare LibBalsaAddressBookRubrica
+
+       Make the structure private; no need for getters and setters.
+
+       * libbalsa/address-book-rubrica.c:
+       * libbalsa/address-book-rubrica.h:
+
 2019-05-22  Albrecht Dreß  <albrecht dress arcor de>
 
        Mitigate “Re: What's Up Johnny?” vulnerabilities
diff --git a/libbalsa/address-book-rubrica.c b/libbalsa/address-book-rubrica.c
index 8aa2f8641..60fd481e5 100644
--- a/libbalsa/address-book-rubrica.c
+++ b/libbalsa/address-book-rubrica.c
@@ -1,7 +1,7 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
 /* Balsa E-Mail Client
  *
- * Copyright (C) 1997-2016 Stuart Parmenter and others,
+ * Copyright (C) 1997-2019 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
  *
  * Rubrica2 address book support was written by Copyright (C)
@@ -89,6 +89,18 @@ static gchar *xml_node_get_text(xmlNodePtr node);
 
 #define CXMLCHARP(x)  ((const xmlChar *)(x))
 
+struct _LibBalsaAddressBookRubrica {
+    LibBalsaAddressBookText parent;
+
+    GSList *item_list;
+    time_t mtime;
+    LibBalsaCompletion *name_complete;
+};
+
+struct _LibBalsaAddressBookRubricaClass {
+    LibBalsaAddressBookTextClass parent_class;
+};
+
 G_DEFINE_TYPE(LibBalsaAddressBookRubrica, libbalsa_address_book_rubrica,
         LIBBALSA_TYPE_ADDRESS_BOOK_TEXT);
 
diff --git a/libbalsa/address-book-rubrica.h b/libbalsa/address-book-rubrica.h
index 571ce621f..d0135f8d6 100644
--- a/libbalsa/address-book-rubrica.h
+++ b/libbalsa/address-book-rubrica.h
@@ -1,7 +1,7 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
 /* Balsa E-Mail Client
  *
- * Copyright (C) 1997-2016 Stuart Parmenter and others,
+ * Copyright (C) 1997-2019 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
  *
  * Rubrica2 address book support was written by Copyright (C)
@@ -30,25 +30,9 @@
 
 #include "address-book-text.h"
 
-#define LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA             (libbalsa_address_book_rubrica_get_type())
-#define LIBBALSA_ADDRESS_BOOK_RUBRICA(obj)             (G_TYPE_CHECK_INSTANCE_CAST (obj, 
LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA, LibBalsaAddressBookRubrica))
-#define LIBBALSA_ADDRESS_BOOK_RUBRICA_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST (klass, 
LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA, LibBalsaAddressBookRubricaClass))
-#define LIBBALSA_IS_ADDRESS_BOOK_RUBRICA(obj)          (G_TYPE_CHECK_INSTANCE_TYPE (obj, 
LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA))
-#define LIBBALSA_IS_ADDRESS_BOOK_RUBRICA_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE (klass, 
LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA))
-
-struct _LibBalsaAddressBookRubrica {
-    LibBalsaAddressBookText parent;
-};
-
-struct _LibBalsaAddressBookRubricaClass {
-    LibBalsaAddressBookTextClass parent_class;
-};
-
-typedef struct _LibBalsaAddressBookRubrica LibBalsaAddressBookRubrica;
-typedef struct _LibBalsaAddressBookRubricaClass
-    LibBalsaAddressBookRubricaClass;
-
-GType libbalsa_address_book_rubrica_get_type(void);
+#define LIBBALSA_TYPE_ADDRESS_BOOK_RUBRICA libbalsa_address_book_rubrica_get_type()
+G_DECLARE_FINAL_TYPE(LibBalsaAddressBookRubrica, libbalsa_address_book_rubrica,
+                     LIBBALSA, ADDRESS_BOOK_RUBRICA, LibBalsaAddressBookText)
 
 LibBalsaAddressBook *libbalsa_address_book_rubrica_new(const gchar * name,
                                                       const gchar * path);


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