diff options
author | Pablo Barciela <[email protected]> | 2019-09-04 01:24:04 +0200 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-10-02 06:48:58 -0400 |
commit | 26da2557c9533adad570051e26ced830a231ecfa (patch) | |
tree | 8ca14f07f09123b5d40b332c12aeb791739fa5ad /src/gs-monitor.c | |
parent | 3d5528708318ec980af0f8530a5906a39e3ac015 (diff) | |
download | mate-screensaver-26da2557c9533adad570051e26ced830a231ecfa.tar.bz2 mate-screensaver-26da2557c9533adad570051e26ced830a231ecfa.tar.xz |
gs-monitor: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gs-monitor.c')
-rw-r--r-- | src/gs-monitor.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gs-monitor.c b/src/gs-monitor.c index 1601d75..4406942 100644 --- a/src/gs-monitor.c +++ b/src/gs-monitor.c @@ -47,9 +47,6 @@ static void gs_monitor_class_init(GSMonitorClass* klass); static void gs_monitor_init(GSMonitor* monitor); static void gs_monitor_finalize(GObject* object); -#define GS_MONITOR_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), GS_TYPE_MONITOR, GSMonitorPrivate)) - struct GSMonitorPrivate { GSWatcher* watcher; GSListener* listener; @@ -62,15 +59,13 @@ struct GSMonitorPrivate { #define FADE_TIMEOUT 10000 -G_DEFINE_TYPE(GSMonitor, gs_monitor, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (GSMonitor, gs_monitor, G_TYPE_OBJECT) static void gs_monitor_class_init(GSMonitorClass* klass) { GObjectClass* object_class = G_OBJECT_CLASS(klass); object_class->finalize = gs_monitor_finalize; - - g_type_class_add_private(klass, sizeof(GSMonitorPrivate)); } static void manager_activated_cb(GSManager* manager, GSMonitor* monitor) @@ -421,7 +416,7 @@ static void connect_prefs_signals(GSMonitor* monitor) static void gs_monitor_init(GSMonitor* monitor) { - monitor->priv = GS_MONITOR_GET_PRIVATE(monitor); + monitor->priv = gs_monitor_get_instance_private (monitor); monitor->priv->prefs = gs_prefs_new(); connect_prefs_signals(monitor); |