[buoh/cleanups: 4/31] Remove deprecated g_type_class_add_private



commit d69370c6391144d52cb486cd623fc40b4a05bd56
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Sep 14 06:01:20 2018 +0200

    Remove deprecated g_type_class_add_private

 src/buoh-add-comic-dialog.c   |  9 ++-------
 src/buoh-comic-cache.c        |  9 ++-------
 src/buoh-comic-list.c         |  9 ++-------
 src/buoh-comic-loader.c       |  9 ++-------
 src/buoh-comic-manager-date.c | 15 +++++----------
 src/buoh-comic-manager.c      |  9 ++-------
 src/buoh-comic.c              |  9 ++-------
 src/buoh-properties-dialog.c  |  9 ++-------
 src/buoh-view-comic.c         |  9 ++-------
 src/buoh-view-message.c       |  8 ++------
 src/buoh-view.c               |  9 ++-------
 src/buoh-window.c             |  9 ++-------
 src/buoh.c                    |  9 ++-------
 13 files changed, 29 insertions(+), 93 deletions(-)
---
diff --git a/src/buoh-add-comic-dialog.c b/src/buoh-add-comic-dialog.c
index 4478922..ee14fcb 100644
--- a/src/buoh-add-comic-dialog.c
+++ b/src/buoh-add-comic-dialog.c
@@ -34,9 +34,6 @@ struct _BuohAddComicDialogPrivate {
         gint          n_selected;
 };
 
-#define BUOH_ADD_COMIC_DIALOG_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_ADD_COMIC_DIALOG, BuohAddComicDialogPrivate))
-
 static void buoh_add_comic_dialog_init        (BuohAddComicDialog      *dialog);
 static void buoh_add_comic_dialog_class_init  (BuohAddComicDialogClass *klass);
 
@@ -46,12 +43,12 @@ static void buoh_add_comic_toggled_cb             (GtkCellRendererToggle *render
                                                    gchar                 *path,
                                                    gpointer               gdata);
 
-G_DEFINE_TYPE (BuohAddComicDialog, buoh_add_comic_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohAddComicDialog, buoh_add_comic_dialog, GTK_TYPE_DIALOG)
 
 static void
 buoh_add_comic_dialog_init (BuohAddComicDialog *dialog)
 {
-        dialog->priv = BUOH_ADD_COMIC_DIALOG_GET_PRIVATE (dialog);
+        dialog->priv = buoh_add_comic_dialog_get_instance_private (dialog);
 
         gtk_widget_init_template (GTK_WIDGET (dialog));
 
@@ -69,8 +66,6 @@ buoh_add_comic_dialog_class_init (BuohAddComicDialogClass *klass)
 {
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohAddComicDialogPrivate));
-
         gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/buoh/ui/add-comic-dialog.ui");
 
         gtk_widget_class_bind_template_child (widget_class, BuohAddComicDialog, selected_label);
diff --git a/src/buoh-comic-cache.c b/src/buoh-comic-cache.c
index f5b512c..c74471c 100644
--- a/src/buoh-comic-cache.c
+++ b/src/buoh-comic-cache.c
@@ -38,21 +38,18 @@ struct _BuohComicCachePrivate {
         gchar      *current_uri;
 };
 
-#define BUOH_COMIC_CACHE_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_CACHE, BuohComicCachePrivate))
-
 #define CACHE_SIZE 1048576 /* 1MB */
 
 static void buoh_comic_cache_init       (BuohComicCache *buoh_comic_cache);
 static void buoh_comic_cache_class_init (BuohComicCacheClass *klass);
 static void buoh_comic_cache_finalize   (GObject *object);
 
-G_DEFINE_TYPE (BuohComicCache, buoh_comic_cache, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohComicCache, buoh_comic_cache, G_TYPE_OBJECT)
 
 static void
 buoh_comic_cache_init (BuohComicCache *buoh_comic_cache)
 {
-        buoh_comic_cache->priv = BUOH_COMIC_CACHE_GET_PRIVATE (buoh_comic_cache);
+        buoh_comic_cache->priv = buoh_comic_cache_get_instance_private (buoh_comic_cache);
 
         buoh_comic_cache->priv->cache_dir =
                 g_build_filename (buoh_get_datadir (BUOH), "cache", NULL);
@@ -69,8 +66,6 @@ buoh_comic_cache_class_init (BuohComicCacheClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohComicCachePrivate));
-
         object_class->finalize = buoh_comic_cache_finalize;
 }
 
diff --git a/src/buoh-comic-list.c b/src/buoh-comic-list.c
index 36722f1..1c9b5b1 100644
--- a/src/buoh-comic-list.c
+++ b/src/buoh-comic-list.c
@@ -34,9 +34,6 @@ struct _BuohComicListPrivate {
         BuohView         *view;
 };
 
-#define BUOH_COMIC_LIST_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_LIST, BuohComicListPrivate))
-
 static void buoh_comic_list_init                   (BuohComicList *buoh_comic_list);
 static void buoh_comic_list_class_init             (BuohComicListClass *klass);
 static void buoh_comic_list_finalize               (GObject *object);
@@ -52,7 +49,7 @@ static gboolean buoh_comic_list_visible            (GtkTreeModel     *model,
                                                     GtkTreeIter      *iter,
                                                     gpointer          gdata);
 
-G_DEFINE_TYPE (BuohComicList, buoh_comic_list, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohComicList, buoh_comic_list, GTK_TYPE_BIN)
 
 static void
 buoh_comic_list_selection_changed (GtkTreeSelection *selection, gpointer gdata)
@@ -99,7 +96,7 @@ buoh_comic_list_init (BuohComicList *buoh_comic_list)
         GtkTreeViewColumn *column;
         GtkTreeSelection  *selection;
 
-        buoh_comic_list->priv = BUOH_COMIC_LIST_GET_PRIVATE (buoh_comic_list);
+        buoh_comic_list->priv = buoh_comic_list_get_instance_private (buoh_comic_list);
 
         buoh_comic_list->priv->comic_manager = NULL;
         buoh_comic_list->priv->view = NULL;
@@ -149,8 +146,6 @@ buoh_comic_list_class_init (BuohComicListClass *klass)
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohComicListPrivate));
-
         widget_class->get_preferred_width = buoh_comic_list_get_preferred_width;
         widget_class->size_allocate = buoh_comic_list_size_allocate;
 
diff --git a/src/buoh-comic-loader.c b/src/buoh-comic-loader.c
index 469f9a8..eae217a 100644
--- a/src/buoh-comic-loader.c
+++ b/src/buoh-comic-loader.c
@@ -64,9 +64,6 @@ struct _BuohComicLoaderPrivate {
         GError             *error;
 };
 
-#define BUOH_COMIC_LOADER_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_LOADER, BuohComicLoaderPrivate))
-
 
 enum {
         FINISHED,
@@ -81,7 +78,7 @@ static void     buoh_comic_loader_finalize      (GObject              *object);
 
 static void     buoh_comic_loader_clear         (BuohComicLoader      *loader);
 
-G_DEFINE_TYPE (BuohComicLoader, buoh_comic_loader, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohComicLoader, buoh_comic_loader, G_TYPE_OBJECT)
 
 GQuark
 buoh_comic_loader_error_quark (void)
@@ -98,7 +95,7 @@ buoh_comic_loader_error_quark (void)
 static void
 buoh_comic_loader_init (BuohComicLoader *loader)
 {
-        loader->priv = BUOH_COMIC_LOADER_GET_PRIVATE (loader);
+        loader->priv = buoh_comic_loader_get_instance_private (loader);
 }
 
 static void
@@ -106,8 +103,6 @@ buoh_comic_loader_class_init (BuohComicLoaderClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohComicLoaderPrivate));
-
         buoh_comic_loader_signals [FINISHED] =
                 g_signal_new ("finished",
                               BUOH_TYPE_COMIC_LOADER,
diff --git a/src/buoh-comic-manager-date.c b/src/buoh-comic-manager-date.c
index 1bea418..6760786 100644
--- a/src/buoh-comic-manager-date.c
+++ b/src/buoh-comic-manager-date.c
@@ -23,9 +23,6 @@
 #include "buoh.h"
 #include "buoh-comic-manager-date.h"
 
-#define BUOH_COMIC_MANAGER_DATE_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE((object), BUOH_TYPE_COMIC_MANAGER_DATE, BuohComicManagerDatePrivate))
-
 #define URI_BUFFER 256
 #define ID_BUFFER 100
 
@@ -62,14 +59,14 @@ static const gchar *day_names[] = {
         N_("Sunday")
 };
 
-G_DEFINE_TYPE (BuohComicManagerDate, buoh_comic_manager_date, BUOH_TYPE_COMIC_MANAGER)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohComicManagerDate, buoh_comic_manager_date, BUOH_TYPE_COMIC_MANAGER)
 
 static void
 buoh_comic_manager_date_init (BuohComicManagerDate *comic_manager)
 {
         gint i;
 
-        comic_manager->priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
+        comic_manager->priv = buoh_comic_manager_date_get_instance_private (comic_manager);
 
         for (i = G_DATE_BAD_WEEKDAY; i <= G_DATE_SUNDAY; i++) {
                 comic_manager->priv->publications[i] = TRUE;
@@ -88,8 +85,6 @@ buoh_comic_manager_date_class_init (BuohComicManagerDateClass *klass)
         manager_class->get_first    = buoh_comic_manager_date_get_first;
         manager_class->is_the_first = buoh_comic_manager_date_is_the_first;
 
-        g_type_class_add_private (klass, sizeof (BuohComicManagerDatePrivate));
-
         object_class->finalize = buoh_comic_manager_date_finalize;
 }
 
@@ -342,7 +337,7 @@ buoh_comic_manager_date_get_last (BuohComicManager *comic_manager)
         BuohComicManagerDatePrivate *priv;
         GList                       *comic_list, *found;
 
-        priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
+        priv = buoh_comic_manager_date_get_instance_private (BUOH_COMIC_MANAGER_DATE (comic_manager));
 
         date = g_date_new ();
 
@@ -398,7 +393,7 @@ buoh_comic_manager_date_is_the_first_comic (BuohComicManager *comic_manager,
 
         g_assert (BUOH_IS_COMIC (comic));
 
-        priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
+        priv = buoh_comic_manager_date_get_instance_private (BUOH_COMIC_MANAGER_DATE (comic_manager));
 
         date = buoh_comic_get_date (comic);
 
@@ -425,7 +420,7 @@ buoh_comic_manager_date_get_first (BuohComicManager *comic_manager)
         BuohComicManagerDatePrivate *priv;
         BuohComic                   *comic;
 
-        priv = BUOH_COMIC_MANAGER_DATE_GET_PRIVATE (comic_manager);
+        priv = buoh_comic_manager_date_get_instance_private (BUOH_COMIC_MANAGER_DATE (comic_manager));
 
         g_object_get (G_OBJECT (comic_manager),
                       "list", &comic_list,
diff --git a/src/buoh-comic-manager.c b/src/buoh-comic-manager.c
index 6f8a3e8..636e09e 100644
--- a/src/buoh-comic-manager.c
+++ b/src/buoh-comic-manager.c
@@ -23,9 +23,6 @@
 #include "buoh-comic-manager.h"
 #include "buoh-comic-manager-date.h"
 
-#define BUOH_COMIC_MANAGER_GET_PRIVATE(object) \
-               (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC_MANAGER, BuohComicManagerPrivate))
-
 enum {
         PROP_0,
         PROP_ID,
@@ -59,12 +56,12 @@ static void buoh_comic_manager_set_property (GObject               *object,
                                              const GValue          *value,
                                              GParamSpec            *pspec);
 
-G_DEFINE_ABSTRACT_TYPE (BuohComicManager, buoh_comic_manager, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (BuohComicManager, buoh_comic_manager, G_TYPE_OBJECT)
 
 static void
 buoh_comic_manager_init (BuohComicManager *comic_manager)
 {
-        comic_manager->priv = BUOH_COMIC_MANAGER_GET_PRIVATE (comic_manager);
+        comic_manager->priv = buoh_comic_manager_get_instance_private (comic_manager);
 
         comic_manager->priv->author      = NULL;
         comic_manager->priv->title       = NULL;
@@ -80,8 +77,6 @@ buoh_comic_manager_class_init (BuohComicManagerClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohComicManagerPrivate));
-
         object_class->set_property = buoh_comic_manager_set_property;
         object_class->get_property = buoh_comic_manager_get_property;
 
diff --git a/src/buoh-comic.c b/src/buoh-comic.c
index e56cf09..be09f2e 100644
--- a/src/buoh-comic.c
+++ b/src/buoh-comic.c
@@ -46,9 +46,6 @@ struct _BuohComicPrivate {
         BuohComicCache *cache;
 };
 
-#define BUOH_COMIC_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_COMIC, BuohComicPrivate))
-
 static void buoh_comic_init         (BuohComic      *buoh_comic);
 static void buoh_comic_class_init   (BuohComicClass *klass);
 static void buoh_comic_finalize     (GObject        *object);
@@ -61,12 +58,12 @@ static void buoh_comic_set_property (GObject        *object,
                                      const GValue   *value,
                                      GParamSpec     *pspec);
 
-G_DEFINE_TYPE (BuohComic, buoh_comic, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohComic, buoh_comic, G_TYPE_OBJECT)
 
 static void
 buoh_comic_init (BuohComic *buoh_comic)
 {
-        buoh_comic->priv = BUOH_COMIC_GET_PRIVATE (buoh_comic);
+        buoh_comic->priv = buoh_comic_get_instance_private (buoh_comic);
 
         buoh_comic->priv->id = NULL;
         buoh_comic->priv->uri = NULL;
@@ -80,8 +77,6 @@ buoh_comic_class_init (BuohComicClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohComicPrivate));
-
         object_class->set_property = buoh_comic_set_property;
         object_class->get_property = buoh_comic_get_property;
 
diff --git a/src/buoh-properties-dialog.c b/src/buoh-properties-dialog.c
index 2e89328..749c5be 100644
--- a/src/buoh-properties-dialog.c
+++ b/src/buoh-properties-dialog.c
@@ -32,18 +32,15 @@ struct _BuohPropertiesDialogPrivate {
         BuohComicManager *comic_manager;
 };
 
-#define BUOH_PROPERTIES_DIALOG_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_PROPERTIES_DIALOG, BuohPropertiesDialogPrivate))
-
 static void buoh_properties_dialog_init       (BuohPropertiesDialog      *dialog);
 static void buoh_properties_dialog_class_init (BuohPropertiesDialogClass *klass);
 
-G_DEFINE_TYPE (BuohPropertiesDialog, buoh_properties_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohPropertiesDialog, buoh_properties_dialog, GTK_TYPE_DIALOG)
 
 static void
 buoh_properties_dialog_init (BuohPropertiesDialog *dialog)
 {
-        dialog->priv = BUOH_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
+        dialog->priv = buoh_properties_dialog_get_instance_private (dialog);
 
         gtk_widget_init_template (GTK_WIDGET (dialog));
 }
@@ -53,8 +50,6 @@ buoh_properties_dialog_class_init (BuohPropertiesDialogClass *klass)
 {
         GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohPropertiesDialogPrivate));
-
         gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/buoh/ui/properties-dialog.ui");
 
         gtk_widget_class_bind_template_child (widget_class, BuohPropertiesDialog, title);
diff --git a/src/buoh-view-comic.c b/src/buoh-view-comic.c
index bd4338d..5d924f9 100644
--- a/src/buoh-view-comic.c
+++ b/src/buoh-view-comic.c
@@ -55,9 +55,6 @@ static const GtkTargetEntry targets[] = {
         { "x-url/http",    0, 0 }
 };
 
-#define BUOH_VIEW_COMIC_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_VIEW_COMIC, BuohViewComicPrivate))
-
 #define ZOOM_IN_FACTOR  1.2
 #define ZOOM_OUT_FACTOR (1.0 / ZOOM_IN_FACTOR)
 
@@ -112,14 +109,14 @@ static void     buoh_view_comic_zoom                  (BuohViewComic    *c_view,
                                                        gdouble           factor,
                                                        gboolean          relative);
 
-G_DEFINE_TYPE (BuohViewComic, buoh_view_comic, GTK_TYPE_VIEWPORT)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohViewComic, buoh_view_comic, GTK_TYPE_VIEWPORT)
 
 static void
 buoh_view_comic_init (BuohViewComic *c_view)
 {
         gtk_widget_set_can_focus (GTK_WIDGET (c_view), TRUE);
 
-        c_view->priv = BUOH_VIEW_COMIC_GET_PRIVATE (c_view);
+        c_view->priv = buoh_view_comic_get_instance_private (c_view);
 
         c_view->priv->zoom_mode = VIEW_ZOOM_FIT_WIDTH;
         c_view->priv->scale = 1.0;
@@ -191,8 +188,6 @@ buoh_view_comic_class_init (BuohViewComicClass *klass)
                                                               1.0,
                                                               G_PARAM_READWRITE));
 
-        g_type_class_add_private (klass, sizeof (BuohViewComicPrivate));
-
         object_class->finalize = buoh_view_comic_finalize;
         object_class->dispose = buoh_view_comic_dispose;
 }
diff --git a/src/buoh-view-message.c b/src/buoh-view-message.c
index 7b414bb..cc3d308 100644
--- a/src/buoh-view-message.c
+++ b/src/buoh-view-message.c
@@ -31,13 +31,10 @@ struct _BuohViewMessagePrivate {
         GtkWidget *icon;
 };
 
-#define BUOH_VIEW_MESSAGE_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_VIEW_MESSAGE, BuohViewMessagePrivate))
-
 static void buoh_view_message_init          (BuohViewMessage *m_view);
 static void buoh_view_message_class_init    (BuohViewMessageClass *klass);
 
-G_DEFINE_TYPE (BuohViewMessage, buoh_view_message, GTK_TYPE_VIEWPORT)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohViewMessage, buoh_view_message, GTK_TYPE_VIEWPORT)
 
 static void
 buoh_view_message_init (BuohViewMessage *m_view)
@@ -48,7 +45,7 @@ buoh_view_message_init (BuohViewMessage *m_view)
 
         gtk_widget_set_can_focus (GTK_WIDGET (m_view), TRUE);
 
-        m_view->priv = BUOH_VIEW_MESSAGE_GET_PRIVATE (m_view);
+        m_view->priv = buoh_view_message_get_instance_private (m_view);
 
         vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
 
@@ -94,7 +91,6 @@ buoh_view_message_init (BuohViewMessage *m_view)
 static void
 buoh_view_message_class_init (BuohViewMessageClass *klass)
 {
-        g_type_class_add_private (klass, sizeof (BuohViewMessagePrivate));
 }
 
 GtkWidget *
diff --git a/src/buoh-view.c b/src/buoh-view.c
index 9892ffb..61a72d1 100644
--- a/src/buoh-view.c
+++ b/src/buoh-view.c
@@ -50,9 +50,6 @@ struct _BuohViewPrivate {
         BuohViewStatus   status;
 };
 
-#define BUOH_VIEW_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_VIEW, BuohViewPrivate))
-
 static guint buoh_view_signals[N_SIGNALS];
 
 static void     buoh_view_init               (BuohView       *buoh_view);
@@ -75,7 +72,7 @@ static void     buoh_view_scale_changed_cb   (GObject        *object,
                                               GParamSpec     *arg,
                                               gpointer        gdata);
 
-G_DEFINE_TYPE (BuohView, buoh_view, GTK_TYPE_NOTEBOOK)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohView, buoh_view, GTK_TYPE_NOTEBOOK)
 
 GType
 buoh_view_status_get_type (void)
@@ -125,7 +122,7 @@ buoh_view_init (BuohView *buoh_view)
 
         gtk_widget_set_can_focus (GTK_WIDGET (buoh_view), TRUE);
 
-        buoh_view->priv = BUOH_VIEW_GET_PRIVATE (buoh_view);
+        buoh_view->priv = buoh_view_get_instance_private (buoh_view);
 
         buoh_view->priv->status = STATE_MESSAGE_WELCOME;
 
@@ -201,8 +198,6 @@ buoh_view_class_init (BuohViewClass *klass)
         widget_class->grab_focus = buoh_view_grab_focus;
         widget_class->button_press_event = buoh_view_button_press_event;
 
-        g_type_class_add_private (klass, sizeof (BuohViewPrivate));
-
         /* Properties */
         g_object_class_install_property (object_class,
                                          PROP_STATUS,
diff --git a/src/buoh-window.c b/src/buoh-window.c
index 20fc6c5..c133b88 100644
--- a/src/buoh-window.c
+++ b/src/buoh-window.c
@@ -53,9 +53,6 @@ struct _BuohWindowPrivate {
         GSettings      *lockdown_settings;
 };
 
-#define BUOH_WINDOW_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_WINDOW, BuohWindowPrivate))
-
 #define GS_BUOH_SCHEMA     "org.gnome.buoh"
 #define GS_SHOW_TOOLBAR           "show-toolbar"
 #define GS_SHOW_STATUSBAR  "show-statusbar"
@@ -229,7 +226,7 @@ static const GtkToggleActionEntry menu_toggle_entries[] = {
           G_CALLBACK (buoh_window_cmd_view_zoom_fit_width) }
 };
 
-G_DEFINE_TYPE (BuohWindow, buoh_window, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (BuohWindow, buoh_window, GTK_TYPE_WINDOW)
 
 static void
 buoh_window_init (BuohWindow *buoh_window)
@@ -246,7 +243,7 @@ buoh_window_init (BuohWindow *buoh_window)
         gboolean          visible_statusbar;
         BuohViewZoomMode  zoom_mode;
 
-        buoh_window->priv = BUOH_WINDOW_GET_PRIVATE (buoh_window);
+        buoh_window->priv = buoh_window_get_instance_private (buoh_window);
 
         gtk_window_set_title (GTK_WINDOW (buoh_window), "Buoh");
         gtk_window_set_icon_name (GTK_WINDOW (buoh_window), "buoh");
@@ -400,8 +397,6 @@ buoh_window_class_init (BuohWindowClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohWindowPrivate));
-
         object_class->finalize = buoh_window_finalize;
 }
 
diff --git a/src/buoh.c b/src/buoh.c
index 6586027..f01f6a3 100644
--- a/src/buoh.c
+++ b/src/buoh.c
@@ -47,9 +47,6 @@ struct _BuohPrivate {
         gchar        *datadir;
 };
 
-#define BUOH_GET_PRIVATE(object) \
-        (G_TYPE_INSTANCE_GET_PRIVATE ((object), BUOH_TYPE_BUOH, BuohPrivate))
-
 static void          buoh_init                   (Buoh         *buoh);
 static void          buoh_class_init             (BuohClass    *klass);
 static void          buoh_finalize               (GObject      *object);
@@ -62,7 +59,7 @@ static void          buoh_save_comic_list        (GtkTreeModel *model,
                                                   gpointer      gdata);
 static void          buoh_create_user_dir        (Buoh         *buoh);
 
-G_DEFINE_TYPE (Buoh, buoh, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (Buoh, buoh, G_TYPE_OBJECT)
 
 void
 buoh_debug (const gchar *format, ...)
@@ -385,7 +382,7 @@ buoh_create_user_dir (Buoh *buoh)
 static void
 buoh_init (Buoh *buoh)
 {
-        buoh->priv = BUOH_GET_PRIVATE (buoh);
+        buoh->priv = buoh_get_instance_private (buoh);
 
         buoh->priv->datadir = g_build_filename (g_get_home_dir (), ".buoh", NULL);
         buoh_create_user_dir (buoh);
@@ -403,8 +400,6 @@ buoh_class_init (BuohClass *klass)
 {
         GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-        g_type_class_add_private (klass, sizeof (BuohPrivate));
-
         object_class->finalize = buoh_finalize;
 }
 


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