From 0ef5cb38c1962372d4caebe62a2fd442351fe318 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Mon, 8 Jul 2019 02:14:54 +0200 Subject: pluma-close-confirmation-dialog: avoid 'g_type_class_add_private' --- pluma/dialogs/pluma-close-confirmation-dialog.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pluma/dialogs/pluma-close-confirmation-dialog.c b/pluma/dialogs/pluma-close-confirmation-dialog.c index 8c48c631..8f1fbdd4 100644 --- a/pluma/dialogs/pluma-close-confirmation-dialog.c +++ b/pluma/dialogs/pluma-close-confirmation-dialog.c @@ -77,15 +77,11 @@ struct _PlumaCloseConfirmationDialogPrivate gboolean disable_save_to_disk; }; -#define PLUMA_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \ - PLUMA_TYPE_CLOSE_CONFIRMATION_DIALOG, \ - PlumaCloseConfirmationDialogPrivate)) - #define GET_MODE(priv) (((priv->unsaved_documents != NULL) && \ (priv->unsaved_documents->next == NULL)) ? \ SINGLE_DOC_MODE : MULTIPLE_DOCS_MODE) -G_DEFINE_TYPE(PlumaCloseConfirmationDialog, pluma_close_confirmation_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE_WITH_PRIVATE (PlumaCloseConfirmationDialog, pluma_close_confirmation_dialog, GTK_TYPE_DIALOG) static void set_unsaved_document (PlumaCloseConfirmationDialog *dlg, const GList *list); @@ -198,7 +194,7 @@ pluma_close_confirmation_dialog_init (PlumaCloseConfirmationDialog *dlg) { AtkObject *atk_obj; - dlg->priv = PLUMA_CLOSE_CONFIRMATION_DIALOG_GET_PRIVATE (dlg); + dlg->priv = pluma_close_confirmation_dialog_get_instance_private (dlg); dlg->priv->disable_save_to_disk = pluma_app_get_lockdown (pluma_app_get_default ()) @@ -303,8 +299,6 @@ pluma_close_confirmation_dialog_class_init (PlumaCloseConfirmationDialogClass *k gobject_class->get_property = pluma_close_confirmation_dialog_get_property; gobject_class->finalize = pluma_close_confirmation_dialog_finalize; - g_type_class_add_private (klass, sizeof (PlumaCloseConfirmationDialogPrivate)); - g_object_class_install_property (gobject_class, PROP_UNSAVED_DOCUMENTS, g_param_spec_pointer ("unsaved_documents", -- cgit v1.2.1