summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-09-06 12:22:42 +0200
committerVictor Kareh <[email protected]>2019-10-02 06:48:58 -0400
commitf0a3ffd59a70f790ff1cddfdd00f0d7c04727107 (patch)
tree3ec0de22301cc5c7b2e3c321fb9ff0f163b997cc
parent79c4651c507f37e5b391e059447ba248a5f94e0b (diff)
downloadmate-screensaver-f0a3ffd59a70f790ff1cddfdd00f0d7c04727107.tar.bz2
mate-screensaver-f0a3ffd59a70f790ff1cddfdd00f0d7c04727107.tar.xz
copy-theme-dialog: avoid 'g_type_class_add_private'
-rw-r--r--src/copy-theme-dialog.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/copy-theme-dialog.c b/src/copy-theme-dialog.c
index fe02f52..8b4d9b9 100644
--- a/src/copy-theme-dialog.c
+++ b/src/copy-theme-dialog.c
@@ -83,45 +83,15 @@ struct _CopyThemeDialogPrivate
GCancellable *cancellable;
};
-guint signals[SIGNAL_COUNT] = {0, 0};
-
-GType
-copy_theme_dialog_get_type (void)
-{
- static GType copy_theme_dialog_type = 0;
-
- if (!copy_theme_dialog_type)
- {
- static GTypeInfo copy_theme_dialog_info =
- {
- sizeof (CopyThemeDialogClass),
- NULL, /* GBaseInitFunc */
- NULL, /* GBaseFinalizeFunc */
- (GClassInitFunc) copy_theme_dialog_class_init,
- NULL, /* GClassFinalizeFunc */
- NULL, /* data */
- sizeof (CopyThemeDialog),
- 0, /* n_preallocs */
- (GInstanceInitFunc) copy_theme_dialog_init,
- NULL
- };
-
- copy_theme_dialog_type = g_type_register_static (GTK_TYPE_DIALOG,
- "CopyThemeDialog",
- &copy_theme_dialog_info,
- 0);
- }
+G_DEFINE_TYPE_WITH_PRIVATE (CopyThemeDialog, copy_theme_dialog, GTK_TYPE_DIALOG)
- return copy_theme_dialog_type;
-}
+guint signals[SIGNAL_COUNT] = {0, 0};
static void
copy_theme_dialog_class_init (CopyThemeDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CopyThemeDialogPrivate));
-
klass->cancelled = copy_theme_dialog_cancel;
object_class->finalize = copy_theme_dialog_finalize;
@@ -186,8 +156,7 @@ copy_theme_dialog_init (CopyThemeDialog *dlg)
char *markup;
gchar *theme_dir_path;
- dlg->priv = G_TYPE_INSTANCE_GET_PRIVATE (dlg, COPY_THEME_DIALOG_TYPE,
- CopyThemeDialogPrivate);
+ dlg->priv = copy_theme_dialog_get_instance_private (dlg);
/* Find and, if needed, create the directory for storing themes */
theme_dir_path = g_build_filename (g_get_user_data_dir (),