[rhythmbox/deprecations: 13/13] replace g_type_class_add_private() with G_ADD_PRIVATE()



commit c28c4061e1e3a2827b3a798f0d51269f03143385
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Jan 1 18:21:45 2020 +1000

    replace g_type_class_add_private() with G_ADD_PRIVATE()

 backends/gstreamer/rb-encoder-gst.c                |  5 ++---
 backends/gstreamer/rb-player-gst-xfade.c           | 23 +++++++++-----------
 backends/gstreamer/rb-player-gst.c                 | 18 ++++++----------
 lib/rb-async-copy.c                                |  6 ++----
 lib/rb-chunk-loader.c                              |  6 ++----
 lib/rb-string-value-map.c                          |  7 +++---
 lib/rb-task-progress-simple.c                      |  5 ++---
 lib/rb-thread.c                                    |  8 ++-----
 metadata/rb-ext-db.c                               |  6 ++----
 metadata/rb-metadata-dbus-client.c                 |  6 ++----
 metadata/rb-metadata-gst.c                         |  8 +++----
 plugins/android/rb-android-source.c                |  5 ++---
 plugins/audiocd/rb-audiocd-source.c                |  6 ++----
 plugins/audioscrobbler/rb-audioscrobbler-account.c |  8 ++-----
 .../rb-audioscrobbler-profile-page.c               |  6 ++----
 .../rb-audioscrobbler-radio-source.c               |  8 ++-----
 plugins/audioscrobbler/rb-audioscrobbler-service.c |  8 ++-----
 plugins/audioscrobbler/rb-audioscrobbler-user.c    |  8 ++-----
 plugins/audioscrobbler/rb-audioscrobbler.c         |  8 ++-----
 plugins/daap/rb-daap-container-record.c            | 21 +++++++++---------
 plugins/daap/rb-daap-record.c                      | 23 +++++++++++---------
 plugins/daap/rb-daap-source.c                      |  8 ++-----
 plugins/daap/rb-dacp-pairing-page.c                |  8 ++-----
 plugins/daap/rb-dacp-player.c                      |  5 ++---
 plugins/daap/rb-dmap-container-db-adapter.c        | 20 +++++++++--------
 plugins/daap/rb-rhythmdb-dmap-db-adapter.c         | 21 ++++++++++--------
 .../daap/rb-rhythmdb-query-model-dmap-db-adapter.c | 21 ++++++++++--------
 plugins/fmradio/rb-fm-radio-source.c               |  7 ++----
 plugins/fmradio/rb-radio-tuner-v4l2.c              |  7 ++----
 .../rb-generic-player-playlist-source.c            | 10 ++++-----
 plugins/generic-player/rb-generic-player-source.c  |  5 ++---
 plugins/grilo/rb-grilo-source.c                    |  6 ++----
 plugins/ipod/rb-ipod-db.c                          |  6 ++----
 plugins/ipod/rb-ipod-source.c                      |  5 ++---
 plugins/ipod/rb-ipod-static-playlist-source.c      |  6 ++----
 plugins/iradio/rb-iradio-source.c                  |  8 ++-----
 plugins/iradio/rb-station-properties-dialog.c      |  6 ++----
 plugins/mtpdevice/rb-mtp-source.c                  |  7 +++---
 podcast/rb-feed-podcast-properties-dialog.c        |  9 +++-----
 podcast/rb-podcast-add-dialog.c                    |  8 ++-----
 podcast/rb-podcast-main-source.c                   |  8 ++-----
 podcast/rb-podcast-manager.c                       |  9 ++------
 podcast/rb-podcast-properties-dialog.c             |  9 +++-----
 podcast/rb-podcast-source.c                        |  8 ++-----
 rhythmdb/rhythmdb-entry-type.c                     |  8 ++-----
 rhythmdb/rhythmdb-import-job.c                     |  7 ++----
 rhythmdb/rhythmdb-metadata-cache.c                 |  8 ++-----
 rhythmdb/rhythmdb-property-model.c                 | 17 ++++++---------
 rhythmdb/rhythmdb-query-model.c                    | 25 ++++++++++------------
 rhythmdb/rhythmdb-query-result-list.c              |  7 ++----
 rhythmdb/rhythmdb-tree.c                           |  9 +++-----
 rhythmdb/rhythmdb.c                                |  7 ++----
 shell/rb-application.c                             |  9 ++------
 shell/rb-history.c                                 |  8 ++-----
 shell/rb-play-order-queue.c                        |  8 +++----
 shell/rb-play-order-random.c                       |  9 +++-----
 shell/rb-play-order-random.h                       |  2 +-
 shell/rb-play-order-shuffle.c                      |  7 ++----
 shell/rb-play-order.c                              |  8 ++-----
 shell/rb-playlist-manager.c                        |  9 ++------
 shell/rb-removable-media-manager.c                 |  6 ++----
 shell/rb-shell-clipboard.c                         |  8 ++-----
 shell/rb-shell-player.c                            |  8 ++-----
 shell/rb-shell-preferences.c                       |  8 ++-----
 shell/rb-shell.c                                   |  6 +++---
 shell/rb-track-transfer-batch.c                    |  7 ++----
 shell/rb-track-transfer-queue.c                    |  9 ++------
 sources/rb-auto-playlist-source.c                  |  6 ++----
 sources/rb-browser-source.c                        |  8 ++-----
 sources/rb-display-page-group.c                    |  8 ++-----
 sources/rb-display-page-menu.c                     |  6 ++----
 sources/rb-display-page-tree.c                     |  9 ++------
 sources/rb-display-page.c                          |  7 +++---
 sources/rb-import-errors-source.c                  |  6 ++----
 sources/rb-library-source.c                        |  7 ++----
 sources/rb-media-player-source.c                   | 12 ++++-------
 sources/rb-missing-files-source.c                  |  6 ++----
 sources/rb-play-queue-source.c                     |  6 ++----
 sources/rb-playlist-source.c                       |  8 ++-----
 sources/rb-source.c                                |  7 +++---
 sources/rb-static-playlist-source.c                | 10 +++------
 sources/rb-streaming-source.c                      |  8 ++-----
 sources/sync/rb-sync-settings-ui.c                 |  6 ++----
 sources/sync/rb-sync-settings.c                    |  5 ++---
 sources/sync/rb-sync-state-ui.c                    |  6 ++----
 sources/sync/rb-sync-state.c                       |  6 ++----
 widgets/eggwrapbox.c                               |  6 ++----
 widgets/gossip-cell-renderer-expander.c            | 25 +++++++++++-----------
 widgets/rb-button-bar.c                            |  6 ++----
 widgets/rb-cell-renderer-rating.c                  |  9 ++------
 widgets/rb-encoding-settings.c                     |  8 ++-----
 widgets/rb-entry-view.c                            |  6 ++----
 widgets/rb-fading-image.c                          |  6 ++----
 widgets/rb-header.c                                |  6 ++----
 widgets/rb-import-dialog.c                         |  6 +-----
 widgets/rb-library-browser.c                       |  8 +++----
 widgets/rb-object-property-editor.c                |  8 ++-----
 widgets/rb-property-view.c                         |  8 ++-----
 widgets/rb-query-creator.c                         |  6 ++----
 widgets/rb-rating.c                                |  7 ++----
 widgets/rb-search-entry.c                          |  7 ++----
 widgets/rb-segmented-bar.c                         |  6 ++----
 widgets/rb-song-info.c                             |  8 ++-----
 widgets/rb-source-toolbar.c                        |  5 ++---
 widgets/rb-task-list-display.c                     |  6 ++----
 widgets/rb-uri-dialog.c                            |  8 ++-----
 106 files changed, 314 insertions(+), 584 deletions(-)
---
diff --git a/backends/gstreamer/rb-encoder-gst.c b/backends/gstreamer/rb-encoder-gst.c
index b9551216c..76269ea2d 100644
--- a/backends/gstreamer/rb-encoder-gst.c
+++ b/backends/gstreamer/rb-encoder-gst.c
@@ -81,6 +81,7 @@ struct _RBEncoderGstPrivate {
 };
 
 G_DEFINE_TYPE_WITH_CODE(RBEncoderGst, rb_encoder_gst, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RBEncoderGst)
                        G_IMPLEMENT_INTERFACE(RB_TYPE_ENCODER,
                                              rb_encoder_init))
 
@@ -900,7 +901,7 @@ impl_finalize (GObject *object)
 static void
 rb_encoder_gst_init (RBEncoderGst *encoder)
 {
-        encoder->priv = (G_TYPE_INSTANCE_GET_PRIVATE ((encoder), RB_TYPE_ENCODER_GST, RBEncoderGstPrivate));
+        encoder->priv = rb_encoder_gst_get_instance_private (encoder);
 }
 
 static void
@@ -917,8 +918,6 @@ rb_encoder_gst_class_init (RBEncoderGstClass *klass)
         GObjectClass *object_class = (GObjectClass *) klass;
 
         object_class->finalize = impl_finalize;
-
-        g_type_class_add_private (klass, sizeof (RBEncoderGstPrivate));
 }
 
 RBEncoder*
diff --git a/backends/gstreamer/rb-player-gst-xfade.c b/backends/gstreamer/rb-player-gst-xfade.c
index 420cf7f65..2352bf747 100644
--- a/backends/gstreamer/rb-player-gst-xfade.c
+++ b/backends/gstreamer/rb-player-gst-xfade.c
@@ -194,16 +194,6 @@ static gboolean silencesrc_push (RBPlayerGstXFade *player);
 GType rb_xfade_stream_get_type (void);
 GType rb_xfade_stream_bin_get_type (void);
 
-G_DEFINE_TYPE_WITH_CODE(RBPlayerGstXFade, rb_player_gst_xfade, G_TYPE_OBJECT,
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER,
-                                             rb_player_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_TEE,
-                                             rb_player_gst_tee_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_FILTER,
-                                             rb_player_gst_filter_init))
-
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_PLAYER_GST_XFADE, RBPlayerGstXFadePrivate))
-
 #define RB_PLAYER_GST_XFADE_TICK_HZ 5
 
 #define EPSILON                        (0.001)
@@ -285,6 +275,15 @@ struct _RBPlayerGstXFadePrivate
        guint silence_idle_id;
 };
 
+G_DEFINE_TYPE_WITH_CODE(RBPlayerGstXFade, rb_player_gst_xfade, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RBPlayerGstXFade)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER,
+                                             rb_player_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_TEE,
+                                             rb_player_gst_tee_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_FILTER,
+                                             rb_player_gst_filter_init))
+
 
 /* these aren't actually used to construct bitmasks,
  * but we search the list that way.
@@ -708,8 +707,6 @@ rb_player_gst_xfade_class_init (RBPlayerGstXFadeClass *klass)
                              G_TYPE_ARRAY,
                              1,
                              G_TYPE_STRING);
-
-       g_type_class_add_private (klass, sizeof (RBPlayerGstXFadePrivate));
 }
 
 static void
@@ -747,7 +744,7 @@ rb_player_gst_filter_init (RBPlayerGstFilterIface *iface)
 static void
 rb_player_gst_xfade_init (RBPlayerGstXFade *player)
 {
-       player->priv = GET_PRIVATE (player);
+       player->priv = rb_player_gst_xfade_get_instance_private (player);
 
        g_rec_mutex_init (&player->priv->stream_list_lock);
        g_rec_mutex_init (&player->priv->sink_lock);
diff --git a/backends/gstreamer/rb-player-gst.c b/backends/gstreamer/rb-player-gst.c
index 01d915e87..44ccca97e 100644
--- a/backends/gstreamer/rb-player-gst.c
+++ b/backends/gstreamer/rb-player-gst.c
@@ -52,11 +52,6 @@ static void rb_player_gst_filter_init (RBPlayerGstFilterIface *iface);
 
 static void state_change_finished (RBPlayerGst *mp, GError *error);
 
-G_DEFINE_TYPE_WITH_CODE(RBPlayerGst, rb_player_gst, G_TYPE_OBJECT,
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER, rb_player_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_FILTER, rb_player_gst_filter_init)
-                       )
-
 #define RB_PLAYER_GST_TICK_HZ 5
 #define STATE_CHANGE_MESSAGE_TIMEOUT 5
 
@@ -126,6 +121,12 @@ struct _RBPlayerGstPrivate
        GCond eos_cond;
 };
 
+G_DEFINE_TYPE_WITH_CODE(RBPlayerGst, rb_player_gst, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RBPlayerGst)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER, rb_player_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_PLAYER_GST_FILTER, rb_player_gst_filter_init)
+                       )
+
 static void
 _destroy_stream_data (RBPlayerGst *player)
 {
@@ -1027,10 +1028,7 @@ rb_player_gst_new (GError **error)
 static void
 rb_player_gst_init (RBPlayerGst *mp)
 {
-       mp->priv = (G_TYPE_INSTANCE_GET_PRIVATE ((mp),
-                   RB_TYPE_PLAYER_GST,
-                   RBPlayerGstPrivate));
-
+       mp->priv = rb_player_gst_get_instance_private (mp);
        g_mutex_init (&mp->priv->eos_lock);
        g_cond_init (&mp->priv->eos_cond);
 }
@@ -1190,7 +1188,5 @@ rb_player_gst_class_init (RBPlayerGstClass *klass)
                              G_TYPE_NONE,
                              3,
                              G_TYPE_POINTER, G_TYPE_STRV, G_TYPE_STRV);
-
-       g_type_class_add_private (klass, sizeof (RBPlayerGstPrivate));
 }
 
diff --git a/lib/rb-async-copy.c b/lib/rb-async-copy.c
index 3cea9b29c..588bed149 100644
--- a/lib/rb-async-copy.c
+++ b/lib/rb-async-copy.c
@@ -58,7 +58,7 @@ struct _RBAsyncCopyPrivate
        GDestroyNotify destroy_progress_data;
 };
 
-G_DEFINE_TYPE (RBAsyncCopy, rb_async_copy, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (RBAsyncCopy, rb_async_copy, G_TYPE_OBJECT, G_ADD_PRIVATE (RBAsyncCopy));
 
 static void
 progress_cb (goffset current_num_bytes, goffset total_bytes, gpointer data)
@@ -223,7 +223,7 @@ impl_finalize (GObject *object)
 static void
 rb_async_copy_init (RBAsyncCopy *copy)
 {
-       copy->priv = G_TYPE_INSTANCE_GET_PRIVATE (copy, RB_TYPE_ASYNC_COPY, RBAsyncCopyPrivate);
+       copy->priv = rb_async_copy_get_instance_private (copy);
 }
 
 static void
@@ -232,6 +232,4 @@ rb_async_copy_class_init (RBAsyncCopyClass *klass)
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->finalize = impl_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBAsyncCopyPrivate));
 }
diff --git a/lib/rb-chunk-loader.c b/lib/rb-chunk-loader.c
index cf7d5e326..8a9c03cf0 100644
--- a/lib/rb-chunk-loader.c
+++ b/lib/rb-chunk-loader.c
@@ -58,7 +58,7 @@ struct _RBChunkLoaderPrivate
        GDestroyNotify destroy_data;
 };
 
-G_DEFINE_TYPE (RBChunkLoader, rb_chunk_loader, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (RBChunkLoader, rb_chunk_loader, G_TYPE_OBJECT, G_ADD_PRIVATE (RBChunkLoader));
 
 static void
 stream_close_cb (GObject *obj, GAsyncResult *res, gpointer data)
@@ -306,7 +306,7 @@ impl_finalize (GObject *object)
 static void
 rb_chunk_loader_init (RBChunkLoader *loader)
 {
-       loader->priv = G_TYPE_INSTANCE_GET_PRIVATE (loader, RB_TYPE_CHUNK_LOADER, RBChunkLoaderPrivate);
+       loader->priv = rb_chunk_loader_get_instance_private (loader);
 }
 
 static void
@@ -315,6 +315,4 @@ rb_chunk_loader_class_init (RBChunkLoaderClass *klass)
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->finalize = impl_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBChunkLoaderPrivate));
 }
diff --git a/lib/rb-string-value-map.c b/lib/rb-string-value-map.c
index d31dca969..80557600b 100644
--- a/lib/rb-string-value-map.c
+++ b/lib/rb-string-value-map.c
@@ -47,7 +47,8 @@ struct RBStringValueMapPrivate {
        GHashTable *map;
 };
 
-G_DEFINE_TYPE (RBStringValueMap, rb_string_value_map, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBStringValueMap, rb_string_value_map, G_TYPE_OBJECT,
+                        G_ADD_PRIVATE (RBStringValueMap))
 
 
 static void
@@ -56,14 +57,12 @@ rb_string_value_map_class_init (RBStringValueMapClass *klass)
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->finalize = rb_string_value_map_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBStringValueMapPrivate));
 }
 
 static void
 rb_string_value_map_init (RBStringValueMap *map)
 {
-       map->priv = G_TYPE_INSTANCE_GET_PRIVATE (map, RB_TYPE_STRING_VALUE_MAP, RBStringValueMapPrivate);
+       map->priv = rb_string_value_map_get_instance_private (map);
 
        map->priv->map = g_hash_table_new_full (g_str_hash,
                                                g_str_equal,
diff --git a/lib/rb-task-progress-simple.c b/lib/rb-task-progress-simple.c
index 5b17c41a4..d1b0dabb8 100644
--- a/lib/rb-task-progress-simple.c
+++ b/lib/rb-task-progress-simple.c
@@ -65,6 +65,7 @@ G_DEFINE_TYPE_EXTENDED (RBTaskProgressSimple,
                        rb_task_progress_simple,
                        G_TYPE_OBJECT,
                        0,
+                       G_ADD_PRIVATE (RBTaskProgressSimple)
                        G_IMPLEMENT_INTERFACE (RB_TYPE_TASK_PROGRESS, 
rb_task_progress_simple_task_progress_init));
 
 enum {
@@ -163,7 +164,7 @@ impl_finalize (GObject *object)
 static void
 rb_task_progress_simple_init (RBTaskProgressSimple *task)
 {
-       task->priv = G_TYPE_INSTANCE_GET_PRIVATE (task, RB_TYPE_TASK_PROGRESS_SIMPLE, 
RBTaskProgressSimplePrivate);
+       task->priv = rb_task_progress_simple_get_instance_private (task);
 }
 
 static void
@@ -177,8 +178,6 @@ rb_task_progress_simple_class_init (RBTaskProgressSimpleClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBTaskProgressSimplePrivate));
-
        gobject_class->finalize = impl_finalize;
        gobject_class->set_property = impl_set_property;
        gobject_class->get_property = impl_get_property;
diff --git a/lib/rb-thread.c b/lib/rb-thread.c
index 856bdcdf8..7ecf330fd 100644
--- a/lib/rb-thread.c
+++ b/lib/rb-thread.c
@@ -79,8 +79,6 @@ struct RBThreadPrivate
        gint exit_flag;
 };
 
-#define RB_THREAD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_THREAD, RBThreadPrivate))
-
 enum
 {
        PROP_0,
@@ -92,7 +90,7 @@ enum
        PROP_DATA,
 };
 
-G_DEFINE_TYPE(RBThread, rb_thread, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE(RBThread, rb_thread, G_TYPE_OBJECT, G_ADD_PRIVATE (RBThread))
 
 static void
 rb_thread_class_init (RBThreadClass *klass)
@@ -141,14 +139,12 @@ rb_thread_class_init (RBThreadClass *klass)
                                                              "User data",
                                                              "User data",
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBThreadPrivate));
 }
 
 static void
 rb_thread_init (RBThread *thread)
 {
-       thread->priv = RB_THREAD_GET_PRIVATE (thread);
+       thread->priv = rb_thread_get_instnace_private (thread);
 
        thread->priv->action_queue = g_async_queue_new ();
        thread->priv->result_queue = g_async_queue_new ();
diff --git a/metadata/rb-ext-db.c b/metadata/rb-ext-db.c
index 8e671148d..8fef62e21 100644
--- a/metadata/rb-ext-db.c
+++ b/metadata/rb-ext-db.c
@@ -109,7 +109,7 @@ typedef struct {
        gboolean stored;
 } RBExtDBStoreRequest;
 
-G_DEFINE_TYPE (RBExtDB, rb_ext_db, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBExtDB, rb_ext_db, G_TYPE_OBJECT, G_ADD_PRIVATE (RBExtDB))
 
 static void
 free_request (RBExtDBRequest *request)
@@ -402,7 +402,7 @@ impl_finalize (GObject *object)
 static void
 rb_ext_db_init (RBExtDB *store)
 {
-       store->priv = G_TYPE_INSTANCE_GET_PRIVATE (store, RB_TYPE_EXT_DB, RBExtDBPrivate);
+       store->priv = rb_ext_db_get_instance_private (store);
 
        store->priv->store_queue = g_async_queue_new ();
 }
@@ -510,8 +510,6 @@ rb_ext_db_class_init (RBExtDBClass *klass)
                              NULL,
                              G_TYPE_POINTER,
                              1, G_TYPE_VALUE);
-
-       g_type_class_add_private (klass, sizeof (RBExtDBPrivate));
 }
 
 
diff --git a/metadata/rb-metadata-dbus-client.c b/metadata/rb-metadata-dbus-client.c
index 4245bcbf9..261ce320f 100644
--- a/metadata/rb-metadata-dbus-client.c
+++ b/metadata/rb-metadata-dbus-client.c
@@ -93,7 +93,7 @@ struct RBMetaDataPrivate
        GHashTable *metadata;
 };
 
-G_DEFINE_TYPE (RBMetaData, rb_metadata, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBMetaData, rb_metadata, G_TYPE_OBJECT, G_ADD_PRIVATE (RBMetaData))
 
 static void
 rb_metadata_class_init (RBMetaDataClass *klass)
@@ -102,15 +102,13 @@ rb_metadata_class_init (RBMetaDataClass *klass)
 
        object_class->finalize = rb_metadata_finalize;
 
-       g_type_class_add_private (object_class, sizeof (RBMetaDataPrivate));
-
        main_context = g_main_context_new ();   /* maybe not needed? */
 }
 
 static void
 rb_metadata_init (RBMetaData *md)
 {
-       md->priv = G_TYPE_INSTANCE_GET_PRIVATE (md, RB_TYPE_METADATA, RBMetaDataPrivate);
+       md->priv = rb_metadata_get_instance_private (md);
 }
 
 static void
diff --git a/metadata/rb-metadata-gst.c b/metadata/rb-metadata-gst.c
index 123f0a899..db0cab369 100644
--- a/metadata/rb-metadata-gst.c
+++ b/metadata/rb-metadata-gst.c
@@ -51,8 +51,6 @@ typedef enum {
 
 typedef GstElement *(*RBAddTaggerElem) (GstElement *pipeline, GstPad *srcpad, GstTagList *tags);
 
-G_DEFINE_TYPE(RBMetaData, rb_metadata, G_TYPE_OBJECT)
-
 struct RBMetaDataPrivate
 {
        GstDiscovererInfo *info;
@@ -72,6 +70,8 @@ struct RBMetaDataPrivate
        gboolean sink_linked;
 };
 
+G_DEFINE_TYPE_WITH_CODE(RBMetaData, rb_metadata, G_TYPE_OBJECT, G_ADD_PRIVATE (RBMetaData))
+
 void
 rb_metadata_reset (RBMetaData *md)
 {
@@ -1054,7 +1054,7 @@ rb_metadata_finalize (GObject *object)
 static void
 rb_metadata_init (RBMetaData *md)
 {
-       md->priv = (G_TYPE_INSTANCE_GET_PRIVATE ((md), RB_TYPE_METADATA, RBMetaDataPrivate));
+       md->priv = rb_metadata_get_instance_private (md);
 
        md->priv->taggers = g_hash_table_new (g_str_hash, g_str_equal);
 
@@ -1093,8 +1093,6 @@ rb_metadata_class_init (RBMetaDataClass *klass)
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->finalize = rb_metadata_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBMetaDataPrivate));
 }
 
 RBMetaData *
diff --git a/plugins/android/rb-android-source.c b/plugins/android/rb-android-source.c
index 69a2fca73..89014b52c 100644
--- a/plugins/android/rb-android-source.c
+++ b/plugins/android/rb-android-source.c
@@ -110,10 +110,11 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        rb_android_source,
        RB_TYPE_MEDIA_PLAYER_SOURCE,
        0,
+       G_ADD_PRIVATE_DYNAMIC (RBAndroidSource)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_DEVICE_SOURCE, rb_android_device_source_init)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_TRANSFER_TARGET, rb_android_transfer_target_init))
 
-#define GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_ANDROID_SOURCE, RBAndroidSourcePrivate))
+#define GET_PRIVATE(o)   (rb_android_source_get_instance_private (RB_ANDROID_SOURCE (o)))
 
 static void
 free_space_cb (GObject *obj, GAsyncResult *res, gpointer data)
@@ -1163,8 +1164,6 @@ rb_android_source_class_init (RBAndroidSourceClass *klass)
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
        g_object_class_override_property (object_class, PROP_DEVICE_SERIAL, "serial");
-
-       g_type_class_add_private (klass, sizeof (RBAndroidSourcePrivate));
 }
 
 static void
diff --git a/plugins/audiocd/rb-audiocd-source.c b/plugins/audiocd/rb-audiocd-source.c
index d55045854..e5463dba4 100644
--- a/plugins/audiocd/rb-audiocd-source.c
+++ b/plugins/audiocd/rb-audiocd-source.c
@@ -126,6 +126,7 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        rb_audiocd_source,
        RB_TYPE_SOURCE,
        0,
+       G_ADD_PRIVATE_DYNAMIC (RBAudioCdSource)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_DEVICE_SOURCE,
                                       rb_audiocd_device_source_init))
 
@@ -206,7 +207,6 @@ rb_audiocd_source_class_init (RBAudioCdSourceClass *klass)
                                                              "volume",
                                                              G_TYPE_VOLUME,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-       g_type_class_add_private (klass, sizeof (RBAudioCdSourcePrivate));
 }
 
 static void
@@ -217,9 +217,7 @@ rb_audiocd_source_class_finalize (RBAudioCdSourceClass *klass)
 static void
 rb_audiocd_source_init (RBAudioCdSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source,
-                                                   RB_TYPE_AUDIOCD_SOURCE,
-                                                   RBAudioCdSourcePrivate);
+       source->priv = rb_audiocd_source_get_instance_private (source);
 }
 
 static void
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-account.c 
b/plugins/audioscrobbler/rb-audioscrobbler-account.c
index 9192c0c2d..77caa26cf 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-account.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-account.c
@@ -61,8 +61,6 @@ struct _RBAudioscrobblerAccountPrivate
        SoupSession *soup_session;
 };
 
-#define RB_AUDIOSCROBBLER_ACCOUNT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_AUDIOSCROBBLER_ACCOUNT, RBAudioscrobblerAccountPrivate))
-
 static void          rb_audioscrobbler_account_class_init (RBAudioscrobblerAccountClass *klass);
 static void          rb_audioscrobbler_account_init (RBAudioscrobblerAccount *account);
 static void          rb_audioscrobbler_account_constructed (GObject *object);
@@ -108,7 +106,7 @@ enum
 
 static guint rb_audioscrobbler_account_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobblerAccount, rb_audioscrobbler_account, G_TYPE_OBJECT)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobblerAccount, rb_audioscrobbler_account, G_TYPE_OBJECT, 0, 
G_ADD_PRIVATE_DYNAMIC (RBAudioscrobblerAccount))
 
 RBAudioscrobblerAccount *
 rb_audioscrobbler_account_new (RBAudioscrobblerService *service)
@@ -180,8 +178,6 @@ rb_audioscrobbler_account_class_init (RBAudioscrobblerAccountClass *klass)
                              G_TYPE_NONE,
                              1,
                              RB_TYPE_AUDIOSCROBBLER_ACCOUNT_LOGIN_STATUS);
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerAccountPrivate));
 }
 
 static void
@@ -192,7 +188,7 @@ rb_audioscrobbler_account_class_finalize (RBAudioscrobblerAccountClass *klass)
 static void
 rb_audioscrobbler_account_init (RBAudioscrobblerAccount *account)
 {
-       account->priv = RB_AUDIOSCROBBLER_ACCOUNT_GET_PRIVATE (account);
+       account->priv = rb_audioscrobbler_account_get_instance_private (account);
 
        account->priv->username = NULL;
        account->priv->auth_token = NULL;
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c 
b/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
index 7a575f697..e0c04ea40 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-page.c
@@ -235,7 +235,7 @@ enum {
        PROP_TOOLBAR_MENU
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobblerProfilePage, rb_audioscrobbler_profile_page, RB_TYPE_DISPLAY_PAGE)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobblerProfilePage, rb_audioscrobbler_profile_page, 
RB_TYPE_DISPLAY_PAGE, 0, G_ADD_PRIVATE_DYNAMIC (RBAudioscrobblerProfilePage))
 
 RBDisplayPage *
 rb_audioscrobbler_profile_page_new (RBShell *shell, GObject *plugin, RBAudioscrobblerService *service)
@@ -303,8 +303,6 @@ rb_audioscrobbler_profile_page_class_init (RBAudioscrobblerProfilePageClass *kla
                                                              "toolbar menu",
                                                              G_TYPE_MENU,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerProfilePagePrivate));
 }
 
 static void
@@ -315,7 +313,7 @@ rb_audioscrobbler_profile_page_class_finalize (RBAudioscrobblerProfilePageClass
 static void
 rb_audioscrobbler_profile_page_init (RBAudioscrobblerProfilePage *page)
 {
-       page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page, RB_TYPE_AUDIOSCROBBLER_PROFILE_PAGE, 
RBAudioscrobblerProfilePagePrivate);
+       page->priv = rb_audioscrobbler_profile_page_get_instance_private (page);
 
        page->priv->button_to_popup_menu_map = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, 
g_object_unref);
        page->priv->popup_menu_to_data_map = g_hash_table_new (g_direct_hash, g_direct_equal);
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c 
b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
index 477f5e69e..ed128edf3 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
@@ -178,8 +178,6 @@ struct _RBAudioscrobblerRadioSourcePrivate
        RBExtDB *art_store;
 };
 
-#define RB_AUDIOSCROBBLER_RADIO_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_AUDIOSCROBBLER_RADIO_SOURCE, RBAudioscrobblerRadioSourcePrivate))
-
 static void rb_audioscrobbler_radio_source_constructed (GObject *object);
 static void rb_audioscrobbler_radio_source_dispose (GObject *object);
 static void rb_audioscrobbler_radio_source_finalize (GObject *object);
@@ -235,7 +233,7 @@ enum {
        PROP_PLAY_ORDER
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobblerRadioSource, rb_audioscrobbler_radio_source, RB_TYPE_STREAMING_SOURCE)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobblerRadioSource, rb_audioscrobbler_radio_source, 
RB_TYPE_STREAMING_SOURCE, 0, G_ADD_PRIVATE_DYNAMIC (RBAudioscrobblerRadioSource))
 
 RBSource *
 rb_audioscrobbler_radio_source_new (RBAudioscrobblerProfilePage *parent,
@@ -354,8 +352,6 @@ rb_audioscrobbler_radio_source_class_init (RBAudioscrobblerRadioSourceClass *kla
        g_object_class_override_property (object_class,
                                          PROP_PLAY_ORDER,
                                          "play-order");
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerRadioSourcePrivate));
 }
 
 static void
@@ -366,7 +362,7 @@ rb_audioscrobbler_radio_source_class_finalize (RBAudioscrobblerRadioSourceClass
 static void
 rb_audioscrobbler_radio_source_init (RBAudioscrobblerRadioSource *source)
 {
-       source->priv = RB_AUDIOSCROBBLER_RADIO_SOURCE_GET_PRIVATE (source);
+       source->priv = rb_audioscrobbler_radio_source_get_instance_private (source);
 
        source->priv->soup_session =
                soup_session_new_with_options (SOUP_SESSION_ADD_FEATURE_BY_TYPE,
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-service.c 
b/plugins/audioscrobbler/rb-audioscrobbler-service.c
index b4764bdb5..4771acc96 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-service.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-service.c
@@ -58,8 +58,6 @@ struct _RBAudioscrobblerServicePrivate {
        char *api_secret;
 };
 
-#define RB_AUDIOSCROBBLER_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_AUDIOSCROBBLER_SERVICE, RBAudioscrobblerServicePrivate))
-
 static void rb_audioscrobbler_service_finalize (GObject *object);
 static void rb_audioscrobbler_service_get_property (GObject *object,
                                                     guint prop_id,
@@ -82,7 +80,7 @@ enum
        PROP_API_SECRET,
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobblerService, rb_audioscrobbler_service, G_TYPE_OBJECT)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobblerService, rb_audioscrobbler_service, G_TYPE_OBJECT, 0, 
G_ADD_PRIVATE_DYNAMIC (RBAudioscrobblerService))
 
 RBAudioscrobblerService *
 rb_audioscrobbler_service_new_lastfm (void)
@@ -177,8 +175,6 @@ rb_audioscrobbler_service_class_init (RBAudioscrobblerServiceClass *klass)
                                                              "API secret",
                                                              NULL,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerServicePrivate));
 }
 
 static void
@@ -189,7 +185,7 @@ rb_audioscrobbler_service_class_finalize (RBAudioscrobblerServiceClass *klass)
 static void
 rb_audioscrobbler_service_init (RBAudioscrobblerService *service)
 {
-       service->priv = RB_AUDIOSCROBBLER_SERVICE_GET_PRIVATE (service);
+       service->priv = rb_audioscrobbler_service_get_instance_private (service);
 }
 
 static void
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-user.c b/plugins/audioscrobbler/rb-audioscrobbler-user.c
index 001802468..0686bd93c 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-user.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-user.c
@@ -135,8 +135,6 @@ struct _RBAudioscrobblerUserPrivate {
        GHashTable *file_to_cancellable_map;
 };
 
-#define RB_AUDIOSCROBBLER_USER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_AUDIOSCROBBLER_USER, RBAudioscrobblerUserPrivate))
-
 static void rb_audioscrobbler_user_constructed (GObject *object);
 static void rb_audioscrobbler_user_dispose (GObject* object);
 static void rb_audioscrobbler_user_finalize (GObject *object);
@@ -243,7 +241,7 @@ enum {
 
 static guint rb_audioscrobbler_user_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobblerUser, rb_audioscrobbler_user, G_TYPE_OBJECT)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobblerUser, rb_audioscrobbler_user, G_TYPE_OBJECT, 0, 
G_ADD_PRIVATE_DYNAMIC (RBAudioscrobblerUser))
 
 RBAudioscrobblerUser *
 rb_audioscrobbler_user_new (RBAudioscrobblerService *service)
@@ -338,8 +336,6 @@ rb_audioscrobbler_user_class_init (RBAudioscrobblerUserClass *klass)
                              G_TYPE_NONE,
                              1,
                              G_TYPE_PTR_ARRAY);
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerUserPrivate));
 }
 
 static void
@@ -350,7 +346,7 @@ rb_audioscrobbler_user_class_finalize (RBAudioscrobblerUserClass *klass)
 static void
 rb_audioscrobbler_user_init (RBAudioscrobblerUser *user)
 {
-       user->priv = RB_AUDIOSCROBBLER_USER_GET_PRIVATE (user);
+       user->priv = rb_audioscrobbler_user_get_instance_private (user);
 
        user->priv->soup_session =
                soup_session_new_with_options (SOUP_SESSION_ADD_FEATURE_BY_TYPE,
diff --git a/plugins/audioscrobbler/rb-audioscrobbler.c b/plugins/audioscrobbler/rb-audioscrobbler.c
index 59a054205..c0f70b888 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler.c
@@ -126,8 +126,6 @@ struct _RBAudioscrobblerPrivate
        gulong offline_play_notify_id;
 };
 
-#define RB_AUDIOSCROBBLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_AUDIOSCROBBLER, 
RBAudioscrobblerPrivate))
-
 
 static gboolean             rb_audioscrobbler_load_queue (RBAudioscrobbler *audioscrobbler);
 static int          rb_audioscrobbler_save_queue (RBAudioscrobbler *audioscrobbler);
@@ -192,7 +190,7 @@ enum
 
 static guint rb_audioscrobbler_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_DYNAMIC_TYPE (RBAudioscrobbler, rb_audioscrobbler, G_TYPE_OBJECT)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBAudioscrobbler, rb_audioscrobbler, G_TYPE_OBJECT, 0, G_ADD_PRIVATE 
(RBAudioscrobbler))
 
 
 static void
@@ -314,8 +312,6 @@ rb_audioscrobbler_class_init (RBAudioscrobblerClass *klass)
                              G_TYPE_UINT,
                              G_TYPE_UINT,
                              G_TYPE_STRING);
-
-       g_type_class_add_private (klass, sizeof (RBAudioscrobblerPrivate));
 }
 
 static void
@@ -330,7 +326,7 @@ rb_audioscrobbler_init (RBAudioscrobbler *audioscrobbler)
        rb_debug ("Plugin ID: %s, Version %s (Protocol %s)",
                  CLIENT_ID, CLIENT_VERSION, SCROBBLER_VERSION);
 
-       audioscrobbler->priv = RB_AUDIOSCROBBLER_GET_PRIVATE (audioscrobbler);
+       audioscrobbler->priv = rb_audioscrobbler_get_instance_private (audioscrobbler);
 
        audioscrobbler->priv->queue = g_queue_new();
        audioscrobbler->priv->submission = g_queue_new();
diff --git a/plugins/daap/rb-daap-container-record.c b/plugins/daap/rb-daap-container-record.c
index fe972ded0..950ff1ad1 100644
--- a/plugins/daap/rb-daap-container-record.c
+++ b/plugins/daap/rb-daap-container-record.c
@@ -44,11 +44,21 @@ enum {
        PROP_NAME
 };
 
+static void rb_daap_container_record_daap_iface_init (gpointer iface, gpointer data);
+
 struct RBDAAPContainerRecordPrivate {
        char *name;
        RBPlaylistSource *source;
 };
 
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPContainerRecord,
+                               rb_daap_container_record,
+                               G_TYPE_OBJECT,
+                               0,
+                               G_ADD_PRIVATE_DYNAMIC (RBDAAPContainerRecord)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_CONTAINER_RECORD,
+                                                              rb_daap_container_record_daap_iface_init))
+
 static void rb_daap_container_record_finalize (GObject *object);
 
 static void
@@ -129,7 +139,7 @@ rb_daap_container_record_get_entries (DMAPContainerRecord *record)
 static void
 rb_daap_container_record_init (RBDAAPContainerRecord *record)
 {
-       record->priv = RB_DAAP_CONTAINER_RECORD_GET_PRIVATE (record);
+       record->priv = rb_daap_container_record_get_instance_private (record);
 }
 
 static void
@@ -137,8 +147,6 @@ rb_daap_container_record_class_init (RBDAAPContainerRecordClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBDAAPContainerRecordPrivate));
-
        gobject_class->set_property = rb_daap_container_record_set_property;
        gobject_class->get_property = rb_daap_container_record_get_property;
        gobject_class->finalize     = rb_daap_container_record_finalize;
@@ -164,13 +172,6 @@ rb_daap_container_record_daap_iface_init (gpointer iface, gpointer data)
        dmap_container_record->get_entries = rb_daap_container_record_get_entries;
 }
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPContainerRecord,
-                               rb_daap_container_record,
-                               G_TYPE_OBJECT,
-                               0,
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_CONTAINER_RECORD,
-                                                              rb_daap_container_record_daap_iface_init))
-
 static void
 rb_daap_container_record_finalize (GObject *object)
 {
diff --git a/plugins/daap/rb-daap-record.c b/plugins/daap/rb-daap-record.c
index 400ad97a5..45387bd82 100644
--- a/plugins/daap/rb-daap-record.c
+++ b/plugins/daap/rb-daap-record.c
@@ -37,6 +37,9 @@
 #include "rhythmdb.h"
 #include "rb-daap-record.h"
 
+static void rb_daap_record_daap_iface_init (gpointer iface, gpointer data);
+static void rb_daap_record_dmap_iface_init (gpointer iface, gpointer data);
+
 struct RBDAAPRecordPrivate {
        guint64 filesize;
        char *location;
@@ -61,6 +64,15 @@ struct RBDAAPRecordPrivate {
        gint64 albumid;
 };
 
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPRecord,
+                               rb_daap_record,
+                               G_TYPE_OBJECT,
+                               0,
+                               G_ADD_PRIVATE_DYNAMIC (RBDAAPRecord)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DAAP_TYPE_RECORD, 
rb_daap_record_daap_iface_init)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_RECORD, 
rb_daap_record_dmap_iface_init))
+
+
 enum {
        PROP_0,
        PROP_LOCATION,
@@ -281,7 +293,7 @@ rb_daap_record_read (DAAPRecord *record, GError **error)
 static void
 rb_daap_record_init (RBDAAPRecord *record)
 {
-       record->priv = RB_DAAP_RECORD_GET_PRIVATE (record);
+       record->priv = rb_daap_record_get_instance_private (record);
 
         record->priv->location         = NULL;
         record->priv->format           = NULL;
@@ -310,8 +322,6 @@ rb_daap_record_class_init (RBDAAPRecordClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBDAAPRecordPrivate));
-
        gobject_class->set_property = rb_daap_record_set_property;
        gobject_class->get_property = rb_daap_record_get_property;
        gobject_class->finalize     = rb_daap_record_finalize;
@@ -369,13 +379,6 @@ rb_daap_record_dmap_iface_init (gpointer iface, gpointer data)
        g_assert (G_TYPE_FROM_INTERFACE (dmap_record) == DMAP_TYPE_RECORD);
 }
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPRecord,
-                               rb_daap_record,
-                               G_TYPE_OBJECT,
-                               0,
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DAAP_TYPE_RECORD, 
rb_daap_record_daap_iface_init)
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_RECORD, 
rb_daap_record_dmap_iface_init))
-
 static void
 rb_daap_record_finalize (GObject *object)
 {
diff --git a/plugins/daap/rb-daap-source.c b/plugins/daap/rb-daap-source.c
index ef30cd8fa..f1204937b 100644
--- a/plugins/daap/rb-daap-source.c
+++ b/plugins/daap/rb-daap-source.c
@@ -107,7 +107,7 @@ enum {
        PROP_PASSWORD_PROTECTED
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBDAAPSource, rb_daap_source, RB_TYPE_BROWSER_SOURCE);
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPSource, rb_daap_source, RB_TYPE_BROWSER_SOURCE, 0, 
G_ADD_PRIVATE_DYNAMIC (RBDAAPSource));
 
 G_DEFINE_DYNAMIC_TYPE (RBDAAPEntryType, rb_daap_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
 
@@ -218,8 +218,6 @@ rb_daap_source_class_init (RBDAAPSourceClass *klass)
                                                               "Whether the share is password protected",
                                                               FALSE,
                                                               G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RBDAAPSourcePrivate));
 }
 
 static void
@@ -230,9 +228,7 @@ rb_daap_source_class_finalize (RBDAAPSourceClass *klass)
 static void
 rb_daap_source_init (RBDAAPSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source,
-                                                   RB_TYPE_DAAP_SOURCE,
-                                                   RBDAAPSourcePrivate);
+       source->priv = rb_daap_source_get_instance_private (source);
 }
 
 static void
diff --git a/plugins/daap/rb-dacp-pairing-page.c b/plugins/daap/rb-dacp-pairing-page.c
index 9dc0ed78c..399c5aa42 100644
--- a/plugins/daap/rb-dacp-pairing-page.c
+++ b/plugins/daap/rb-dacp-pairing-page.c
@@ -104,7 +104,7 @@ enum {
        PROP_SERVICE_NAME
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBDACPPairingPage, rb_dacp_pairing_page, RB_TYPE_DISPLAY_PAGE)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDACPPairingPage, rb_dacp_pairing_page, RB_TYPE_DISPLAY_PAGE, 0, 
G_ADD_PRIVATE_DYNAMIC (RBDACPPairingPage))
 
 static gboolean
 entry_insert_text_cb (GtkWidget *entry, gchar *text, gint len, gint *position, RBDACPPairingPage *page)
@@ -221,8 +221,6 @@ rb_dacp_pairing_page_class_init (RBDACPPairingPageClass *klass)
                                                              "mDNS/DNS-SD service name of the share",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBDACPPairingPagePrivate));
 }
 
 static void
@@ -233,9 +231,7 @@ rb_dacp_pairing_page_class_finalize (RBDACPPairingPageClass *klass)
 static void
 rb_dacp_pairing_page_init (RBDACPPairingPage *page)
 {
-       page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page,
-                                                 RB_TYPE_DACP_PAIRING_PAGE,
-                                                 RBDACPPairingPagePrivate);
+       page->priv = rb_dacp_pairing_page_get_instance_private (page);
 }
 
 static void
diff --git a/plugins/daap/rb-dacp-player.c b/plugins/daap/rb-dacp-player.c
index dce8a2254..4a20223a4 100644
--- a/plugins/daap/rb-dacp-player.c
+++ b/plugins/daap/rb-dacp-player.c
@@ -108,13 +108,14 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDACPPlayer,
                                rb_dacp_player,
                                G_TYPE_OBJECT,
                                0,
+                               G_ADD_PRIVATE_DYNAMIC (RBDACPPlayer)
                                G_IMPLEMENT_INTERFACE_DYNAMIC (DACP_TYPE_PLAYER,
                                                               rb_dacp_player_iface_init))
 
 static void
 rb_dacp_player_init (RBDACPPlayer *object)
 {
-       object->priv = RB_DACP_PLAYER_GET_PRIVATE (object);
+       object->priv = rb_dacp_player_get_instance_private (object);
 }
 
 static void
@@ -135,8 +136,6 @@ rb_dacp_player_class_init (RBDACPPlayerClass *klass)
 {
        GObjectClass* object_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBDACPPlayerPrivate));
-
        object_class->set_property = rb_dacp_player_set_property;
        object_class->get_property = rb_dacp_player_get_property;
        object_class->finalize     = rb_dacp_player_finalize;
diff --git a/plugins/daap/rb-dmap-container-db-adapter.c b/plugins/daap/rb-dmap-container-db-adapter.c
index 11a4b6cc7..dfd33b9af 100644
--- a/plugins/daap/rb-dmap-container-db-adapter.c
+++ b/plugins/daap/rb-dmap-container-db-adapter.c
@@ -36,12 +36,22 @@
 
 #include <libdmapsharing/dmap.h>
 
+static void rb_dmap_container_db_adapter_interface_init (gpointer iface, gpointer data);
+
 static guint next_playlist_id = 2;
 
 struct RBDMAPContainerDbAdapterPrivate {
        RBPlaylistManager *playlist_manager;
 };
 
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDMAPContainerDbAdapter,
+                               rb_dmap_container_db_adapter,
+                               G_TYPE_OBJECT,
+                               0,
+                               G_ADD_PRIVATE_DYNAMIC (RBDMAPContainerDbAdapter)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_CONTAINER_DB,
+                                                              rb_dmap_container_db_adapter_interface_init))
+
 typedef struct ForeachAdapterData {
        gpointer data;
        GHFunc func;
@@ -128,13 +138,12 @@ rb_dmap_container_db_adapter_count (DMAPContainerDb *db)
 static void
 rb_dmap_container_db_adapter_init (RBDMAPContainerDbAdapter *db)
 {
-       db->priv = RB_DMAP_CONTAINER_DB_ADAPTER_GET_PRIVATE (db);
+       db->priv = rb_dmap_container_db_adapter_get_instance_private (db);
 }
 
 static void
 rb_dmap_container_db_adapter_class_init (RBDMAPContainerDbAdapterClass *klass)
 {
-       g_type_class_add_private (klass, sizeof (RBDMAPContainerDbAdapterPrivate));
 }
 
 static void
@@ -154,13 +163,6 @@ rb_dmap_container_db_adapter_interface_init (gpointer iface, gpointer data)
        dmap_db->count = rb_dmap_container_db_adapter_count;
 }
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDMAPContainerDbAdapter,
-                               rb_dmap_container_db_adapter,
-                               G_TYPE_OBJECT,
-                               0,
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_CONTAINER_DB,
-                                                              rb_dmap_container_db_adapter_interface_init))
-
 static void
 assign_id (RBPlaylistManager *mgr,
           RBSource *source)
diff --git a/plugins/daap/rb-rhythmdb-dmap-db-adapter.c b/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
index 412fb2cfb..cad558956 100644
--- a/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
+++ b/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
@@ -38,11 +38,22 @@
 #include <glib/gi18n.h>
 #include <libdmapsharing/dmap.h>
 
+static void rb_rhythmdb_dmap_db_adapter_interface_init (gpointer iface, gpointer data);
+
 struct RBRhythmDBDMAPDbAdapterPrivate {
        RhythmDB *db;
        RhythmDBEntryType *entry_type;
 };
 
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBRhythmDBDMAPDbAdapter,
+                               rb_rhythmdb_dmap_db_adapter,
+                               G_TYPE_OBJECT,
+                               0,
+                               G_ADD_PRIVATE_DYNAMIC (RBRhythmDBDMAPDbAdapter)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_DB,
+                                                              rb_rhythmdb_dmap_db_adapter_interface_init))
+
+
 typedef struct ForeachAdapterData {
        gpointer data;
        GHFunc func;
@@ -248,13 +259,12 @@ rb_rhythmdb_dmap_db_adapter_add (DMAPDb *db, DMAPRecord *record)
 static void
 rb_rhythmdb_dmap_db_adapter_init (RBRhythmDBDMAPDbAdapter *db)
 {
-       db->priv = RB_RHYTHMDB_DMAP_DB_ADAPTER_GET_PRIVATE (db);
+       db->priv = rb_rhythmdb_dmap_db_adapter_get_instance_private (db);
 }
 
 static void
 rb_rhythmdb_dmap_db_adapter_class_init (RBRhythmDBDMAPDbAdapterClass *klass)
 {
-       g_type_class_add_private (klass, sizeof (RBRhythmDBDMAPDbAdapterPrivate));
 }
 
 static void
@@ -275,13 +285,6 @@ rb_rhythmdb_dmap_db_adapter_interface_init (gpointer iface, gpointer data)
        dmap_db->count = rb_rhythmdb_dmap_db_adapter_count;
 }
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBRhythmDBDMAPDbAdapter,
-                               rb_rhythmdb_dmap_db_adapter,
-                               G_TYPE_OBJECT,
-                               0,
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_DB,
-                                                              rb_rhythmdb_dmap_db_adapter_interface_init))
-
 RBRhythmDBDMAPDbAdapter *
 rb_rhythmdb_dmap_db_adapter_new (RhythmDB *rdb, RhythmDBEntryType *entry_type)
 {
diff --git a/plugins/daap/rb-rhythmdb-query-model-dmap-db-adapter.c 
b/plugins/daap/rb-rhythmdb-query-model-dmap-db-adapter.c
index 63462f39b..0bea96948 100644
--- a/plugins/daap/rb-rhythmdb-query-model-dmap-db-adapter.c
+++ b/plugins/daap/rb-rhythmdb-query-model-dmap-db-adapter.c
@@ -37,10 +37,21 @@
 #include <glib/gi18n.h>
 #include <libdmapsharing/dmap.h>
 
+static void rb_rhythmdb_query_model_dmap_db_adapter_interface_init (gpointer iface, gpointer data);
+
 struct RBRhythmDBQueryModelDMAPDbAdapterPrivate {
        RhythmDBQueryModel *model;
 };
 
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBRhythmDBQueryModelDMAPDbAdapter,
+                               rb_rhythmdb_query_model_dmap_db_adapter,
+                               G_TYPE_OBJECT,
+                               0,
+                               G_ADD_PRIVATE_DYNAMIC (RBRhythmDBQueryModelDMAPDbAdapter)
+                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_DB,
+                                                              
rb_rhythmdb_query_model_dmap_db_adapter_interface_init))
+
+
 typedef struct ForeachAdapterData {
        gpointer data;
        GHFunc func;
@@ -119,13 +130,12 @@ rb_rhythmdb_query_model_dmap_db_adapter_add (DMAPDb *db, DMAPRecord *record)
 static void
 rb_rhythmdb_query_model_dmap_db_adapter_init (RBRhythmDBQueryModelDMAPDbAdapter *db)
 {
-       db->priv = RB_RHYTHMDB_QUERY_MODEL_DMAP_DB_ADAPTER_GET_PRIVATE (db);
+       db->priv = rb_rhythmdb_query_model_dmap_db_adapter_get_instance_private (db);
 }
 
 static void
 rb_rhythmdb_query_model_dmap_db_adapter_class_init (RBRhythmDBQueryModelDMAPDbAdapterClass *klass)
 {
-       g_type_class_add_private (klass, sizeof (RBRhythmDBQueryModelDMAPDbAdapterPrivate));
 }
 
 static void
@@ -146,13 +156,6 @@ rb_rhythmdb_query_model_dmap_db_adapter_interface_init (gpointer iface, gpointer
        dmap_db->count = rb_rhythmdb_query_model_dmap_db_adapter_count;
 }
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBRhythmDBQueryModelDMAPDbAdapter,
-                               rb_rhythmdb_query_model_dmap_db_adapter,
-                               G_TYPE_OBJECT,
-                               0,
-                               G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_DB,
-                                                              
rb_rhythmdb_query_model_dmap_db_adapter_interface_init))
-
 RBRhythmDBQueryModelDMAPDbAdapter *
 rb_rhythmdb_query_model_dmap_db_adapter_new (RhythmDBQueryModel *model)
 {
diff --git a/plugins/fmradio/rb-fm-radio-source.c b/plugins/fmradio/rb-fm-radio-source.c
index 494ddda65..f4ea040aa 100644
--- a/plugins/fmradio/rb-fm-radio-source.c
+++ b/plugins/fmradio/rb-fm-radio-source.c
@@ -87,7 +87,7 @@ struct _RBFMRadioSourcePrivate {
        GMenuModel *popup;
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBFMRadioSource, rb_fm_radio_source, RB_TYPE_SOURCE);
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBFMRadioSource, rb_fm_radio_source, RB_TYPE_SOURCE, 0, 
G_ADD_PRIVATE_DYNAMIC (RBFMRadioSource));
 
 G_DEFINE_DYNAMIC_TYPE (RBFMRadioEntryType, rb_fm_radio_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
 
@@ -130,8 +130,6 @@ rb_fm_radio_source_class_init (RBFMRadioSourceClass *class)
        source_class->can_pause = (RBSourceFeatureFunc) rb_false_function;
        source_class->delete_selected = impl_delete_selected;
        source_class->get_entry_view = impl_get_entry_view;
-
-       g_type_class_add_private (class, sizeof (RBFMRadioSourcePrivate));
 }
 
 static void
@@ -142,8 +140,7 @@ rb_fm_radio_source_class_finalize (RBFMRadioSourceClass *class)
 static void
 rb_fm_radio_source_init (RBFMRadioSource *self)
 {
-       self->priv = G_TYPE_INSTANCE_GET_PRIVATE (
-               self, RB_TYPE_FM_RADIO_SOURCE, RBFMRadioSourcePrivate);
+       self->priv = rb_fm_radio_source_get_instance_private (self);
 }
 
 static void
diff --git a/plugins/fmradio/rb-radio-tuner-v4l2.c b/plugins/fmradio/rb-radio-tuner-v4l2.c
index 9864b810a..d450766c1 100644
--- a/plugins/fmradio/rb-radio-tuner-v4l2.c
+++ b/plugins/fmradio/rb-radio-tuner-v4l2.c
@@ -50,7 +50,7 @@ struct _RBRadioTunerPrivate {
        guint32 freq_mul;
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBRadioTuner, rb_radio_tuner, G_TYPE_OBJECT);
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBRadioTuner, rb_radio_tuner, G_TYPE_OBJECT, 0, G_ADD_PRIVATE_DYNAMIC 
(RBRadioTuner));
 
 static void rb_radio_tuner_finalize (GObject *object);
 
@@ -60,8 +60,6 @@ rb_radio_tuner_class_init (RBRadioTunerClass *class)
        GObjectClass *object_class = G_OBJECT_CLASS (class);
 
        object_class->finalize = rb_radio_tuner_finalize;
-
-       g_type_class_add_private (class, sizeof (RBRadioTunerPrivate));
 }
 
 static void
@@ -72,8 +70,7 @@ rb_radio_tuner_class_finalize (RBRadioTunerClass *class)
 static void
 rb_radio_tuner_init (RBRadioTuner *self)
 {
-       self->priv = G_TYPE_INSTANCE_GET_PRIVATE(self, RB_TYPE_RADIO_TUNER,
-                                                RBRadioTunerPrivate);
+       self->priv = rb_radio_tuner_get_instance_private (self);
        self->priv->fd = -1;
 }
 
diff --git a/plugins/generic-player/rb-generic-player-playlist-source.c 
b/plugins/generic-player/rb-generic-player-playlist-source.c
index a66d1e429..b941f8e7d 100644
--- a/plugins/generic-player/rb-generic-player-playlist-source.c
+++ b/plugins/generic-player/rb-generic-player-playlist-source.c
@@ -49,11 +49,13 @@ typedef struct
        gboolean loading;
 } RBGenericPlayerPlaylistSourcePrivate;
 
-G_DEFINE_DYNAMIC_TYPE(RBGenericPlayerPlaylistSource,
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(RBGenericPlayerPlaylistSource,
                      rb_generic_player_playlist_source,
-                     RB_TYPE_STATIC_PLAYLIST_SOURCE)
+                     RB_TYPE_STATIC_PLAYLIST_SOURCE,
+                     0,
+                     G_ADD_PRIVATE_DYNAMIC (RBGenericPlayerPlaylistSource))
 
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_GENERIC_PLAYER_PLAYLIST_SOURCE, 
RBGenericPlayerPlaylistSourcePrivate))
+#define GET_PRIVATE(o) (rb_generic_player_playlist_source_get_instance_private 
(RB_GENERIC_PLAYER_PLAYLIST_SOURCE (o)))
 
 enum {
        PROP_0,
@@ -558,8 +560,6 @@ rb_generic_player_playlist_source_class_init (RBGenericPlayerPlaylistSourceClass
                                                              "path to root of the device",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
-       g_type_class_add_private (klass, sizeof (RBGenericPlayerPlaylistSourcePrivate));
 }
 
 static void
diff --git a/plugins/generic-player/rb-generic-player-source.c 
b/plugins/generic-player/rb-generic-player-source.c
index 03e59916c..0aad68f95 100644
--- a/plugins/generic-player/rb-generic-player-source.c
+++ b/plugins/generic-player/rb-generic-player-source.c
@@ -152,10 +152,11 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
        rb_generic_player_source,
        RB_TYPE_MEDIA_PLAYER_SOURCE,
        0,
+       G_ADD_PRIVATE_DYNAMIC (RBGenericPlayerSource)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_DEVICE_SOURCE, rb_generic_player_device_source_init)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_TRANSFER_TARGET, 
rb_generic_player_source_transfer_target_init))
 
-#define GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_GENERIC_PLAYER_SOURCE, 
RBGenericPlayerSourcePrivate))
+#define GET_PRIVATE(o)   (rb_generic_player_source_get_instance_private (RB_GENERIC_PLAYER_SOURCE (o)))
 
 
 static void
@@ -223,8 +224,6 @@ rb_generic_player_source_class_init (RBGenericPlayerSourceClass *klass)
                                                              "GMount object",
                                                              G_TYPE_MOUNT,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBGenericPlayerSourcePrivate));
 }
 
 static void
diff --git a/plugins/grilo/rb-grilo-source.c b/plugins/grilo/rb-grilo-source.c
index d338c14f3..68fcc6b67 100644
--- a/plugins/grilo/rb-grilo-source.c
+++ b/plugins/grilo/rb-grilo-source.c
@@ -133,7 +133,7 @@ struct _RBGriloSourcePrivate
        RhythmDB *db;
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBGriloSource, rb_grilo_source, RB_TYPE_SOURCE)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBGriloSource, rb_grilo_source, RB_TYPE_SOURCE, 0, G_ADD_PRIVATE_DYNAMIC 
(RBGriloSource))
 
 /* entry type */
 
@@ -195,8 +195,6 @@ rb_grilo_source_class_init (RBGriloSourceClass *klass)
                                                              "grilo source object",
                                                              GRL_TYPE_SOURCE,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBGriloSourcePrivate));
 }
 
 static void
@@ -207,7 +205,7 @@ rb_grilo_source_class_finalize (RBGriloSourceClass *klass)
 static void
 rb_grilo_source_init (RBGriloSource *self)
 {
-       self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RB_TYPE_GRILO_SOURCE, RBGriloSourcePrivate);
+       self->priv = rb_grilo_source_get_instance_private (self);
 }
 
 static void
diff --git a/plugins/ipod/rb-ipod-db.c b/plugins/ipod/rb-ipod-db.c
index 049b82583..9f8075b33 100644
--- a/plugins/ipod/rb-ipod-db.c
+++ b/plugins/ipod/rb-ipod-db.c
@@ -116,9 +116,9 @@ typedef struct {
 
 } RbIpodDbPrivate;
 
-G_DEFINE_DYNAMIC_TYPE (RbIpodDb, rb_ipod_db, G_TYPE_OBJECT)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RbIpodDb, rb_ipod_db, G_TYPE_OBJECT, 0, G_ADD_PRIVATE_DYNAMIC (RbIpodDb))
 
-#define IPOD_DB_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_IPOD_DB, RbIpodDbPrivate))
+#define IPOD_DB_GET_PRIVATE(o)   (rb_ipod_db_get_instance_private (RB_IPOD_DB (o)))
 
 enum {
        BEFORE_SAVE,
@@ -233,8 +233,6 @@ rb_ipod_db_class_init (RbIpodDbClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              0);
-
-       g_type_class_add_private (klass, sizeof (RbIpodDbPrivate));
 }
 
 static void
diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c
index 4de0ec0bd..62fe74817 100644
--- a/plugins/ipod/rb-ipod-source.c
+++ b/plugins/ipod/rb-ipod-source.c
@@ -163,10 +163,11 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED(
        rb_ipod_source,
        RB_TYPE_MEDIA_PLAYER_SOURCE,
        0,
+       G_ADD_PRIVATE_DYNAMIC (RBiPodSource)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_DEVICE_SOURCE, rb_ipod_device_source_init)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_TRANSFER_TARGET, rb_ipod_source_transfer_target_init))
 
-#define IPOD_SOURCE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_IPOD_SOURCE, 
RBiPodSourcePrivate))
+#define IPOD_SOURCE_GET_PRIVATE(o)   (rb_ipod_source_get_instance_private (RB_IPOD_SOURCE (o)))
 
 static void
 rb_ipod_source_class_init (RBiPodSourceClass *klass)
@@ -218,8 +219,6 @@ rb_ipod_source_class_init (RBiPodSourceClass *klass)
                                                              G_TYPE_MOUNT,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
        g_object_class_override_property (object_class, PROP_DEVICE_SERIAL, "serial");
-
-       g_type_class_add_private (klass, sizeof (RBiPodSourcePrivate));
 }
 
 static void
diff --git a/plugins/ipod/rb-ipod-static-playlist-source.c b/plugins/ipod/rb-ipod-static-playlist-source.c
index e9e5bb0ac..dd11c1f04 100644
--- a/plugins/ipod/rb-ipod-static-playlist-source.c
+++ b/plugins/ipod/rb-ipod-static-playlist-source.c
@@ -53,9 +53,9 @@ typedef struct
        gboolean        was_reordered;
 } RBIpodStaticPlaylistSourcePrivate;
 
-G_DEFINE_DYNAMIC_TYPE(RBIpodStaticPlaylistSource, rb_ipod_static_playlist_source, 
RB_TYPE_STATIC_PLAYLIST_SOURCE)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(RBIpodStaticPlaylistSource, rb_ipod_static_playlist_source, 
RB_TYPE_STATIC_PLAYLIST_SOURCE, 0, G_ADD_PRIVATE_DYNAMIC (RBIpodStaticPlaylistSource))
 
-#define IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_IPOD_STATIC_PLAYLIST_SOURCE, RBIpodStaticPlaylistSourcePrivate))
+#define IPOD_STATIC_PLAYLIST_SOURCE_GET_PRIVATE(o)   (rb_ipod_static_playlist_source_get_instance_private 
(RB_IPOD_STATIC_PLAYLIST_SOURCE (o)))
 
 enum {
        PROP_0,
@@ -278,8 +278,6 @@ rb_ipod_static_playlist_source_class_init (RBIpodStaticPlaylistSourceClass *klas
                                                              "itdb-playlist",
                                                              "itdb-playlist",
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBIpodStaticPlaylistSourcePrivate));
 }
 
 static void
diff --git a/plugins/iradio/rb-iradio-source.c b/plugins/iradio/rb-iradio-source.c
index a887306b5..452fe0c9b 100644
--- a/plugins/iradio/rb-iradio-source.c
+++ b/plugins/iradio/rb-iradio-source.c
@@ -148,14 +148,12 @@ struct RBIRadioSourcePrivate
        GMenuModel *popup;
 };
 
-#define RB_IRADIO_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_IRADIO_SOURCE, 
RBIRadioSourcePrivate))
-
 static const GtkTargetEntry stations_view_drag_types[] = {
        {  "text/uri-list", 0, 0 },
        {  "_NETSCAPE_URL", 0, 1 },
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBIRadioSource, rb_iradio_source, RB_TYPE_STREAMING_SOURCE);
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBIRadioSource, rb_iradio_source, RB_TYPE_STREAMING_SOURCE, 0, 
G_ADD_PRIVATE_DYNAMIC (RBIRadioSource));
 
 G_DEFINE_DYNAMIC_TYPE (RBIRadioEntryType, rb_iradio_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
 
@@ -207,8 +205,6 @@ rb_iradio_source_class_init (RBIRadioSourceClass *klass)
        g_object_class_override_property (object_class,
                                          PROP_SHOW_BROWSER,
                                          "show-browser");
-
-       g_type_class_add_private (klass, sizeof (RBIRadioSourcePrivate));
 }
 
 static void
@@ -219,7 +215,7 @@ rb_iradio_source_class_finalize (RBIRadioSourceClass *klass)
 static void
 rb_iradio_source_init (RBIRadioSource *source)
 {
-       source->priv = RB_IRADIO_SOURCE_GET_PRIVATE (source);
+       source->priv = rb_iradio_source_get_instance_private (source);
 }
 
 static void
diff --git a/plugins/iradio/rb-station-properties-dialog.c b/plugins/iradio/rb-station-properties-dialog.c
index 1c14aa9c8..f1f29e70b 100644
--- a/plugins/iradio/rb-station-properties-dialog.c
+++ b/plugins/iradio/rb-station-properties-dialog.c
@@ -106,7 +106,7 @@ enum
        PROP_PLUGIN
 };
 
-G_DEFINE_DYNAMIC_TYPE (RBStationPropertiesDialog, rb_station_properties_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBStationPropertiesDialog, rb_station_properties_dialog, GTK_TYPE_DIALOG, 0, 
G_ADD_PRIVATE_DYNAMIC (RBStationPropertiesDialog))
 
 static void
 rb_station_properties_dialog_class_init (RBStationPropertiesDialogClass *klass)
@@ -137,8 +137,6 @@ rb_station_properties_dialog_class_init (RBStationPropertiesDialogClass *klass)
 
        object_class->dispose = rb_station_properties_dialog_dispose;
        object_class->finalize = rb_station_properties_dialog_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBStationPropertiesDialogPrivate));
 }
 
 static void
@@ -149,7 +147,7 @@ rb_station_properties_dialog_class_finalize (RBStationPropertiesDialogClass *kla
 static void
 rb_station_properties_dialog_init (RBStationPropertiesDialog *dialog)
 {
-        dialog->priv = RB_STATION_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
+        dialog->priv = rb_station_properties_dialog_get_instance_private (dialog);
 }
 
 static void
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index 01bed18aa..397a42af9 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -161,10 +161,11 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED(
        rb_mtp_source,
        RB_TYPE_MEDIA_PLAYER_SOURCE,
        0,
+       G_ADD_PRIVATE_DYNAMIC (RBMtpSource)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_DEVICE_SOURCE, rb_mtp_device_source_init)
        G_IMPLEMENT_INTERFACE_DYNAMIC (RB_TYPE_TRANSFER_TARGET, rb_mtp_source_transfer_target_init))
 
-#define MTP_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_MTP_SOURCE, RBMtpSourcePrivate))
+#define MTP_SOURCE_GET_PRIVATE(o) (rb_mtp_source_get_instance_private (RB_MTP_SOURCE (o)))
 
 enum
 {
@@ -230,8 +231,6 @@ rb_mtp_source_class_init (RBMtpSourceClass *klass)
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 #endif
        g_object_class_override_property (object_class, PROP_DEVICE_SERIAL, "serial");
-
-       g_type_class_add_private (klass, sizeof (RBMtpSourcePrivate));
 }
 
 static void
@@ -1247,7 +1246,7 @@ impl_track_added (RBTransferTarget *target,
 
        upload = g_new0 (RBMtpSourceTrackUpload, 1);
        upload->track = track;
-       upload->source = g_object_ref (target);
+       upload->source = RB_MTP_SOURCE (g_object_ref (target));
 
        destfile = g_file_new_for_uri (dest);
        upload->tempfile = g_file_get_path (destfile);
diff --git a/podcast/rb-feed-podcast-properties-dialog.c b/podcast/rb-feed-podcast-properties-dialog.c
index f72e028f1..4f0d210f9 100644
--- a/podcast/rb-feed-podcast-properties-dialog.c
+++ b/podcast/rb-feed-podcast-properties-dialog.c
@@ -82,15 +82,14 @@ struct RBFeedPodcastPropertiesDialogPrivate
        GtkWidget   *close_button;
 };
 
-#define RB_FEED_PODCAST_PROPERTIES_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_FEED_PODCAST_PROPERTIES_DIALOG, RBFeedPodcastPropertiesDialogPrivate))
-
 enum
 {
        PROP_0,
        PROP_BACKEND
 };
 
-G_DEFINE_TYPE (RBFeedPodcastPropertiesDialog, rb_feed_podcast_properties_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (RBFeedPodcastPropertiesDialog, rb_feed_podcast_properties_dialog, GTK_TYPE_DIALOG,
+                        G_ADD_PRIVATE (RBFeedPodcastPropertiesDialog))
 
 static void
 rb_feed_podcast_properties_dialog_class_init (RBFeedPodcastPropertiesDialogClass *klass)
@@ -98,8 +97,6 @@ rb_feed_podcast_properties_dialog_class_init (RBFeedPodcastPropertiesDialogClass
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
        object_class->finalize = rb_feed_podcast_properties_dialog_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBFeedPodcastPropertiesDialogPrivate));
 }
 
 static void
@@ -108,7 +105,7 @@ rb_feed_podcast_properties_dialog_init (RBFeedPodcastPropertiesDialog *dialog)
        GtkWidget  *content_area;
        GtkBuilder *builder;
 
-       dialog->priv = RB_FEED_PODCAST_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
+       dialog->priv = rb_feed_podcast_properties_dialog_get_instance_private (dialog);
 
        g_signal_connect_object (G_OBJECT (dialog),
                                 "response",
diff --git a/podcast/rb-podcast-add-dialog.c b/podcast/rb-podcast-add-dialog.c
index ef9488459..561e62571 100644
--- a/podcast/rb-podcast-add-dialog.c
+++ b/podcast/rb-podcast-add-dialog.c
@@ -117,7 +117,7 @@ static const char *podcast_uri_prefixes[] = {
 
 static guint signals[LAST_SIGNAL] = {0,};
 
-G_DEFINE_TYPE (RBPodcastAddDialog, rb_podcast_add_dialog, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_CODE (RBPodcastAddDialog, rb_podcast_add_dialog, GTK_TYPE_BOX, G_ADD_PRIVATE 
(RBPodcastAddDialog));
 
 
 static gboolean
@@ -896,9 +896,7 @@ impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
 static void
 rb_podcast_add_dialog_init (RBPodcastAddDialog *dialog)
 {
-       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
-                                                   RB_TYPE_PODCAST_ADD_DIALOG,
-                                                   RBPodcastAddDialogPrivate);
+       dialog->priv = rb_podcast_add_dialog_get_instance_private (dialog);
 }
 
 static void
@@ -945,8 +943,6 @@ rb_podcast_add_dialog_class_init (RBPodcastAddDialogClass *klass)
                                        G_TYPE_NONE,
                                        0);
 
-       g_type_class_add_private (object_class, sizeof (RBPodcastAddDialogPrivate));
-
        gtk_binding_entry_add_signal (gtk_binding_set_by_class (klass),
                                      GDK_KEY_Escape,
                                      0,
diff --git a/podcast/rb-podcast-main-source.c b/podcast/rb-podcast-main-source.c
index d59d85f74..0e5662663 100644
--- a/podcast/rb-podcast-main-source.c
+++ b/podcast/rb-podcast-main-source.c
@@ -45,7 +45,7 @@ struct _RBPodcastMainSourcePrivate
        GtkWidget *config_widget;
 };
 
-G_DEFINE_TYPE (RBPodcastMainSource, rb_podcast_main_source, RB_TYPE_PODCAST_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (RBPodcastMainSource, rb_podcast_main_source, RB_TYPE_PODCAST_SOURCE, G_ADD_PRIVATE 
(RBPodcastMainSource))
 
 
 RBSource *
@@ -404,9 +404,7 @@ impl_dispose (GObject *object)
 static void
 rb_podcast_main_source_init (RBPodcastMainSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source,
-                                                   RB_TYPE_PODCAST_MAIN_SOURCE,
-                                                   RBPodcastMainSourcePrivate);
+       source->priv = rb_podcast_main_source_get_instance_private (source);
 }
 
 static void
@@ -423,6 +421,4 @@ rb_podcast_main_source_class_init (RBPodcastMainSourceClass *klass)
 
        source_class->want_uri = impl_want_uri;
        source_class->add_uri = impl_add_uri;
-
-       g_type_class_add_private (klass, sizeof (RBPodcastMainSourcePrivate));
 }
diff --git a/podcast/rb-podcast-manager.c b/podcast/rb-podcast-manager.c
index 6d397437b..3b622b74a 100644
--- a/podcast/rb-podcast-manager.c
+++ b/podcast/rb-podcast-manager.c
@@ -121,9 +121,6 @@ struct RBPodcastManagerPrivate
        GFile *timestamp_file;
 };
 
-#define RB_PODCAST_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_PODCAST_MANAGER, 
RBPodcastManagerPrivate))
-
-
 static guint rb_podcast_manager_signals[LAST_SIGNAL] = { 0 };
 
 /* functions */
@@ -172,7 +169,7 @@ static gboolean end_job                                     (RBPodcastManagerInfo *data);
 static void cancel_job                                 (RBPodcastManagerInfo *pd);
 static void rb_podcast_manager_start_update_timer      (RBPodcastManager *pd);
 
-G_DEFINE_TYPE (RBPodcastManager, rb_podcast_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBPodcastManager, rb_podcast_manager, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RBPodcastManager))
 
 static void
 rb_podcast_manager_class_init (RBPodcastManagerClass *klass)
@@ -246,14 +243,12 @@ rb_podcast_manager_class_init (RBPodcastManagerClass *klass)
                                G_TYPE_STRING,
                                G_TYPE_STRING,
                                G_TYPE_BOOLEAN);
-
-       g_type_class_add_private (klass, sizeof (RBPodcastManagerPrivate));
 }
 
 static void
 rb_podcast_manager_init (RBPodcastManager *pd)
 {
-       pd->priv = RB_PODCAST_MANAGER_GET_PRIVATE (pd);
+       pd->priv = rb_podcast_manager_get_instance_private (pd);
 
        pd->priv->source_sync = 0;
        pd->priv->db = NULL;
diff --git a/podcast/rb-podcast-properties-dialog.c b/podcast/rb-podcast-properties-dialog.c
index c96f86700..d8711f9ce 100644
--- a/podcast/rb-podcast-properties-dialog.c
+++ b/podcast/rb-podcast-properties-dialog.c
@@ -108,7 +108,8 @@ enum
        PROP_BACKEND
 };
 
-G_DEFINE_TYPE (RBPodcastPropertiesDialog, rb_podcast_properties_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (RBPodcastPropertiesDialog, rb_podcast_properties_dialog, GTK_TYPE_DIALOG,
+                        G_ADD_PRIVATE (RBPodcastPropertiesDialog))
 
 /* list of HTML-ish strings that we search for to distinguish plain text from HTML podcast
  * descriptions.  we don't really have anything else to go on - regular content type
@@ -282,8 +283,6 @@ rb_podcast_properties_dialog_class_init (RBPodcastPropertiesDialogClass *klass)
 
        object_class->dispose = rb_podcast_properties_dialog_dispose;
        object_class->finalize = rb_podcast_properties_dialog_finalize;
-
-       g_type_class_add_private (klass, sizeof (RBPodcastPropertiesDialogPrivate));
 }
 
 static void
@@ -293,9 +292,7 @@ rb_podcast_properties_dialog_init (RBPodcastPropertiesDialog *dialog)
        GtkBuilder *builder;
        AtkObject *lobj, *robj;
 
-       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
-                                                   RB_TYPE_PODCAST_PROPERTIES_DIALOG,
-                                                   RBPodcastPropertiesDialogPrivate);
+       dialog->priv = rb_podcast_properties_dialog_get_instance_private (dialog);
 
        g_signal_connect_object (G_OBJECT (dialog),
                                 "response",
diff --git a/podcast/rb-podcast-source.c b/podcast/rb-podcast-source.c
index 98a080fe0..05e3ccf7b 100644
--- a/podcast/rb-podcast-source.c
+++ b/podcast/rb-podcast-source.c
@@ -125,7 +125,7 @@ enum
        PROP_SHOW_BROWSER
 };
 
-G_DEFINE_TYPE (RBPodcastSource, rb_podcast_source, RB_TYPE_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (RBPodcastSource, rb_podcast_source, RB_TYPE_SOURCE, G_ADD_PRIVATE (RBPodcastSource))
 
 static void
 podcast_posts_view_sort_order_changed_cb (GObject *object,
@@ -1630,9 +1630,7 @@ static void
 rb_podcast_source_init (RBPodcastSource *source)
 {
        GtkIconTheme *icon_theme;
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source,
-                                                   RB_TYPE_PODCAST_SOURCE,
-                                                   RBPodcastSourcePrivate);
+       source->priv = rb_podcast_source_get_instance_private (source);
 
        source->priv->selected_feeds = NULL;
 
@@ -1701,6 +1699,4 @@ rb_podcast_source_class_init (RBPodcastSourceClass *klass)
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
 
        g_object_class_override_property (object_class, PROP_SHOW_BROWSER, "show-browser");
-
-       g_type_class_add_private (klass, sizeof (RBPodcastSourcePrivate));
 }
diff --git a/rhythmdb/rhythmdb-entry-type.c b/rhythmdb/rhythmdb-entry-type.c
index bd9fd0208..ba8487e71 100644
--- a/rhythmdb/rhythmdb-entry-type.c
+++ b/rhythmdb/rhythmdb-entry-type.c
@@ -68,7 +68,7 @@ struct _RhythmDBEntryTypePrivate
 };
 
 
-G_DEFINE_TYPE (RhythmDBEntryType, rhythmdb_entry_type, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RhythmDBEntryType, rhythmdb_entry_type, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RhythmDBEntryType))
 
 /**
  * SECTION:rhythmdb-entry-type
@@ -353,9 +353,7 @@ rhythmdb_entry_type_purge_metadata_cache (RhythmDBEntryType *etype, const char *
 static void
 rhythmdb_entry_type_init (RhythmDBEntryType *etype)
 {
-       etype->priv = G_TYPE_INSTANCE_GET_PRIVATE (etype,
-                                                  RHYTHMDB_TYPE_ENTRY_TYPE,
-                                                  RhythmDBEntryTypePrivate);
+       etype->priv = rhythmdb_entry_type_get_instance_private (etype);
 }
 
 static void
@@ -546,8 +544,6 @@ rhythmdb_entry_type_class_init (RhythmDBEntryTypeClass *klass)
                                                              "metadata cache name",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RhythmDBEntryTypePrivate));
 }
 
 
diff --git a/rhythmdb/rhythmdb-import-job.c b/rhythmdb/rhythmdb-import-job.c
index 0b65da12e..a482d5efe 100644
--- a/rhythmdb/rhythmdb-import-job.c
+++ b/rhythmdb/rhythmdb-import-job.c
@@ -107,6 +107,7 @@ G_DEFINE_TYPE_EXTENDED (RhythmDBImportJob,
                        rhythmdb_import_job,
                        G_TYPE_OBJECT,
                        0,
+                       G_ADD_PRIVATE (RhythmDBImportJob)
                        G_IMPLEMENT_INTERFACE (RB_TYPE_TASK_PROGRESS, 
rhythmdb_import_job_task_progress_init));
 
 /**
@@ -575,9 +576,7 @@ entry_added_cb (RhythmDB *db,
 static void
 rhythmdb_import_job_init (RhythmDBImportJob *job)
 {
-       job->priv = G_TYPE_INSTANCE_GET_PRIVATE (job,
-                                                RHYTHMDB_TYPE_IMPORT_JOB,
-                                                RhythmDBImportJobPrivate);
+       job->priv = rhythmdb_import_job_get_instance_private (job);
 
        g_mutex_init (&job->priv->lock);
        job->priv->outstanding = g_queue_new ();
@@ -852,6 +851,4 @@ rhythmdb_import_job_class_init (RhythmDBImportJobClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              1, G_TYPE_INT);
-
-       g_type_class_add_private (klass, sizeof (RhythmDBImportJobPrivate));
 }
diff --git a/rhythmdb/rhythmdb-metadata-cache.c b/rhythmdb/rhythmdb-metadata-cache.c
index e41226770..ab9926bf0 100644
--- a/rhythmdb/rhythmdb-metadata-cache.c
+++ b/rhythmdb/rhythmdb-metadata-cache.c
@@ -95,7 +95,7 @@ struct _RhythmDBMetadataCachePrivate
        guint64 purge_age;
 };
 
-G_DEFINE_TYPE (RhythmDBMetadataCache, rhythmdb_metadata_cache, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_CODE (RhythmDBMetadataCache, rhythmdb_metadata_cache, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RhythmDBMetadataCache));
 
 static GHashTable *instances = NULL;
 
@@ -428,9 +428,7 @@ rhythmdb_metadata_cache_purge (RhythmDBMetadataCache *cache,
 static void
 rhythmdb_metadata_cache_init (RhythmDBMetadataCache *cache)
 {
-       cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache,
-                                                  RHYTHMDB_TYPE_METADATA_CACHE,
-                                                  RhythmDBMetadataCachePrivate);
+       cache->priv = rhythmdb_metadata_cache_get_instance_private (cache);
 }
 
 static void
@@ -548,6 +546,4 @@ rhythmdb_metadata_cache_class_init (RhythmDBMetadataCacheClass *klass)
                                                              "cache file name",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RhythmDBMetadataCachePrivate));
 }
diff --git a/rhythmdb/rhythmdb-property-model.c b/rhythmdb/rhythmdb-property-model.c
index 40ddae468..a7e71b32c 100644
--- a/rhythmdb/rhythmdb-property-model.c
+++ b/rhythmdb/rhythmdb-property-model.c
@@ -42,12 +42,6 @@
 static void rhythmdb_property_model_tree_model_init (GtkTreeModelIface *iface);
 static void rhythmdb_property_model_drag_source_init (RbTreeDragSourceIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE(RhythmDBPropertyModel, rhythmdb_property_model, G_TYPE_OBJECT,
-                       G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
-                                             rhythmdb_property_model_tree_model_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_SOURCE,
-                                             rhythmdb_property_model_drag_source_init))
-
 /*
  * Structure for entries in the property model.
  * The sort string is derived from one of a list of properties, so we
@@ -191,7 +185,12 @@ struct RhythmDBPropertyModelPrivate
        guint syncing_id;
 };
 
-#define RHYTHMDB_PROPERTY_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RHYTHMDB_TYPE_PROPERTY_MODEL, RhythmDBPropertyModelPrivate))
+G_DEFINE_TYPE_WITH_CODE(RhythmDBPropertyModel, rhythmdb_property_model, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RhythmDBPropertyModel)
+                       G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
+                                             rhythmdb_property_model_tree_model_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_SOURCE,
+                                             rhythmdb_property_model_drag_source_init))
 
 enum
 {
@@ -288,8 +287,6 @@ rhythmdb_property_model_class_init (RhythmDBPropertyModelClass *klass)
                                                              "RhythmDBQueryModel object ",
                                                              RHYTHMDB_TYPE_QUERY_MODEL,
                                                              G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RhythmDBPropertyModelPrivate));
 }
 
 static void
@@ -499,7 +496,7 @@ rhythmdb_property_model_init (RhythmDBPropertyModel *model)
                        gtk_target_list_new (targets_composer,
                                             G_N_ELEMENTS (targets_composer));
 
-       model->priv = RHYTHMDB_PROPERTY_MODEL_GET_PRIVATE (model);
+       model->priv = rhythmdb_property_model_get_instance_private (model);
 
        model->priv->stamp = g_random_int ();
 
diff --git a/rhythmdb/rhythmdb-query-model.c b/rhythmdb/rhythmdb-query-model.c
index 98edac918..8395ff6fd 100644
--- a/rhythmdb/rhythmdb-query-model.c
+++ b/rhythmdb/rhythmdb-query-model.c
@@ -53,16 +53,6 @@ static void rhythmdb_query_model_tree_model_init (GtkTreeModelIface *iface);
 static void rhythmdb_query_model_drag_source_init (RbTreeDragSourceIface *iface);
 static void rhythmdb_query_model_drag_dest_init (RbTreeDragDestIface *iface);
 
-G_DEFINE_TYPE_WITH_CODE(RhythmDBQueryModel, rhythmdb_query_model, G_TYPE_OBJECT,
-                       G_IMPLEMENT_INTERFACE(RHYTHMDB_TYPE_QUERY_RESULTS,
-                                             rhythmdb_query_model_query_results_init)
-                       G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
-                                             rhythmdb_query_model_tree_model_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_SOURCE,
-                                             rhythmdb_query_model_drag_source_init)
-                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_DEST,
-                                             rhythmdb_query_model_drag_dest_init))
-
 static void rhythmdb_query_model_init (RhythmDBQueryModel *shell_player);
 static void rhythmdb_query_model_constructed (GObject *object);
 static void rhythmdb_query_model_dispose (GObject *object);
@@ -242,7 +232,16 @@ struct _RhythmDBQueryModelPrivate
        gint query_reapply_timeout_id;
 };
 
-#define RHYTHMDB_QUERY_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RHYTHMDB_TYPE_QUERY_MODEL, 
RhythmDBQueryModelPrivate))
+G_DEFINE_TYPE_WITH_CODE(RhythmDBQueryModel, rhythmdb_query_model, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RhythmDBQueryModel)
+                       G_IMPLEMENT_INTERFACE(RHYTHMDB_TYPE_QUERY_RESULTS,
+                                             rhythmdb_query_model_query_results_init)
+                       G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
+                                             rhythmdb_query_model_tree_model_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_SOURCE,
+                                             rhythmdb_query_model_drag_source_init)
+                       G_IMPLEMENT_INTERFACE(RB_TYPE_TREE_DRAG_DEST,
+                                             rhythmdb_query_model_drag_dest_init))
 
 enum
 {
@@ -493,8 +492,6 @@ rhythmdb_query_model_class_init (RhythmDBQueryModelClass *klass)
                              NULL,
                              G_TYPE_BOOLEAN,
                              1, RHYTHMDB_TYPE_ENTRY);
-
-       g_type_class_add_private (klass, sizeof (RhythmDBQueryModelPrivate));
 }
 
 static void
@@ -669,7 +666,7 @@ rhythmdb_query_model_init (RhythmDBQueryModel *model)
                        = gtk_target_list_new (rhythmdb_query_model_drag_types,
                                               G_N_ELEMENTS (rhythmdb_query_model_drag_types));
 
-       model->priv = RHYTHMDB_QUERY_MODEL_GET_PRIVATE (model);
+       model->priv = rhythmdb_query_model_get_instance_private (model);
 
        model->priv->stamp = g_random_int ();
 
diff --git a/rhythmdb/rhythmdb-query-result-list.c b/rhythmdb/rhythmdb-query-result-list.c
index e8368efa1..b9c8254c4 100644
--- a/rhythmdb/rhythmdb-query-result-list.c
+++ b/rhythmdb/rhythmdb-query-result-list.c
@@ -49,6 +49,7 @@ static guint rhythmdb_query_result_list_signals[LAST_SIGNAL] = { 0 };
 static void rhythmdb_query_result_list_query_results_init (RhythmDBQueryResultsIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE(RhythmDBQueryResultList, rhythmdb_query_result_list, G_TYPE_OBJECT,
+                       G_ADD_PRIVATE (RhythmDBQueryResultList)
                        G_IMPLEMENT_INTERFACE(RHYTHMDB_TYPE_QUERY_RESULTS,
                                              rhythmdb_query_result_list_query_results_init));
 
@@ -97,9 +98,7 @@ impl_finalize (GObject *object)
 static void
 rhythmdb_query_result_list_init (RhythmDBQueryResultList *list)
 {
-       list->priv = G_TYPE_INSTANCE_GET_PRIVATE (list,
-                                                 RHYTHMDB_TYPE_QUERY_RESULT_LIST,
-                                                 RhythmDBQueryResultListPrivate);
+       list->priv = rhythmdb_query_result_list_get_instance_private (list);
 }
 
 static void
@@ -131,8 +130,6 @@ rhythmdb_query_result_list_class_init (RhythmDBQueryResultListClass *klass)
                              NULL, NULL,
                              NULL,
                              G_TYPE_NONE, 0);
-
-       g_type_class_add_private (klass, sizeof (RhythmDBQueryResultListPrivate));
 }
 
 
diff --git a/rhythmdb/rhythmdb-tree.c b/rhythmdb/rhythmdb-tree.c
index d265aae58..a1441cb1b 100644
--- a/rhythmdb/rhythmdb-tree.c
+++ b/rhythmdb/rhythmdb-tree.c
@@ -67,7 +67,6 @@ typedef struct RhythmDBTreeProperty
 
 #define RHYTHMDB_TREE_PROPERTY_FROM_ENTRY(entry) ((RhythmDBTreeProperty *) entry->data)
 
-G_DEFINE_TYPE(RhythmDBTree, rhythmdb_tree, RHYTHMDB_TYPE)
 
 static void rhythmdb_tree_finalize (GObject *object);
 
@@ -151,6 +150,8 @@ struct RhythmDBTreePrivate
        guint idle_load_id;
 };
 
+G_DEFINE_TYPE_WITH_CODE (RhythmDBTree, rhythmdb_tree, RHYTHMDB_TYPE, G_ADD_PRIVATE (RhythmDBTree))
+
 typedef struct
 {
        RBRefString *name;
@@ -163,8 +164,6 @@ typedef struct
        GList *properties;
 } RhythmDBUnknownEntry;
 
-#define RHYTHMDB_TREE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RHYTHMDB_TYPE_TREE, 
RhythmDBTreePrivate))
-
 enum
 {
        PROP_0,
@@ -209,14 +208,12 @@ rhythmdb_tree_class_init (RhythmDBTreeClass *klass)
        rhythmdb_class->impl_evaluate_query = rhythmdb_tree_evaluate_query;
        rhythmdb_class->impl_do_full_query = rhythmdb_tree_do_full_query;
        rhythmdb_class->impl_entry_type_registered = rhythmdb_tree_entry_type_registered;
-
-       g_type_class_add_private (klass, sizeof (RhythmDBTreePrivate));
 }
 
 static void
 rhythmdb_tree_init (RhythmDBTree *db)
 {
-       db->priv = RHYTHMDB_TREE_GET_PRIVATE (db);
+       db->priv = rhythmdb_tree_get_instance_private (db);
 
        db->priv->entries = g_hash_table_new (rb_refstring_hash, rb_refstring_equal);
        db->priv->entry_ids = g_hash_table_new (g_direct_hash, g_direct_equal);
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index fa93ecc92..2720e8133 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -169,8 +169,7 @@ static const RhythmDBPropertyDef rhythmdb_properties[] = {
 #define RB_PARSE_NICK_END (xmlChar *) "]"
 
 
-#define RHYTHMDB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RHYTHMDB_TYPE, RhythmDBPrivate))
-G_DEFINE_ABSTRACT_TYPE(RhythmDB, rhythmdb, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE(RhythmDB, rhythmdb, G_TYPE_OBJECT, G_ADD_PRIVATE (RhythmDB))
 
 /* file attributes requested in RHYTHMDB_ACTION_STAT and RHYTHMDB_ACTION_LOAD */
 #define RHYTHMDB_FILE_INFO_ATTRIBUTES                  \
@@ -614,8 +613,6 @@ rhythmdb_class_init (RhythmDBClass *klass)
                              NULL,
                              G_TYPE_MOUNT_OPERATION,
                              0);
-
-       g_type_class_add_private (klass, sizeof (RhythmDBPrivate));
 }
 
 static void
@@ -704,7 +701,7 @@ rhythmdb_init (RhythmDB *db)
        guint i;
        GEnumClass *prop_class;
 
-       db->priv = RHYTHMDB_GET_PRIVATE (db);
+       db->priv = rhythmdb_get_instance_private (db);
 
        db->priv->settings = g_settings_new ("org.gnome.rhythmbox.rhythmdb");
        g_signal_connect_object (db->priv->settings, "changed", G_CALLBACK (db_settings_changed_cb), db, 0);
diff --git a/shell/rb-application.c b/shell/rb-application.c
index eef4ef6f2..c79f7f622 100644
--- a/shell/rb-application.c
+++ b/shell/rb-application.c
@@ -78,7 +78,7 @@ struct _RBApplicationPrivate
        GList *accelerators;
 };
 
-G_DEFINE_TYPE (RBApplication, rb_application, GTK_TYPE_APPLICATION);
+G_DEFINE_TYPE_WITH_CODE (RBApplication, rb_application, GTK_TYPE_APPLICATION, G_ADD_PRIVATE (RBApplication));
 
 enum {
        PROP_0,
@@ -458,9 +458,7 @@ impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
 static void
 rb_application_init (RBApplication *app)
 {
-       app->priv = G_TYPE_INSTANCE_GET_PRIVATE (app,
-                                                RB_TYPE_APPLICATION,
-                                                RBApplicationPrivate);
+       app->priv = rb_application_get_instance_private (app);
        rb_user_data_dir ();
        rb_refstring_system_init ();
 
@@ -506,9 +504,6 @@ rb_application_class_init (RBApplicationClass *klass)
                                                              "RBShell instance",
                                                              RB_TYPE_SHELL,
                                                              G_PARAM_READABLE));
-
-
-       g_type_class_add_private (klass, sizeof (RBApplicationPrivate));
 }
 
 /**
diff --git a/shell/rb-history.c b/shell/rb-history.c
index 4e114eb63..47dae3e90 100644
--- a/shell/rb-history.c
+++ b/shell/rb-history.c
@@ -61,8 +61,6 @@ struct RBHistoryPrivate
        gpointer destroy_userdata;
 };
 
-#define RB_HISTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_HISTORY, RBHistoryPrivate))
-
 #define MAX_HISTORY_SIZE 50
 
 static void rb_history_class_init (RBHistoryClass *klass);
@@ -91,7 +89,7 @@ enum
        PROP_MAX_SIZE,
 };
 
-G_DEFINE_TYPE (RBHistory, rb_history, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBHistory, rb_history, G_TYPE_OBJECT, G_ADD_PRIVATE (RBHistory))
 
 static void
 rb_history_class_init (RBHistoryClass *klass)
@@ -129,8 +127,6 @@ rb_history_class_init (RBHistoryClass *klass)
                                                            0, G_MAXUINT,
                                                            0,
                                                            G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RBHistoryPrivate));
 }
 
 /**
@@ -163,7 +159,7 @@ rb_history_new (gboolean truncate_on_play, GFunc destroyer, gpointer destroy_use
 static void
 rb_history_init (RBHistory *hist)
 {
-       hist->priv = RB_HISTORY_GET_PRIVATE (hist);
+       hist->priv = rb_history_get_instance_private (hist);
 
        hist->priv->entry_to_seqptr = g_hash_table_new (g_direct_hash,
                                                        g_direct_equal);
diff --git a/shell/rb-play-order-queue.c b/shell/rb-play-order-queue.c
index 946caf064..74986194f 100644
--- a/shell/rb-play-order-queue.c
+++ b/shell/rb-play-order-queue.c
@@ -43,9 +43,6 @@ static void rb_queue_play_order_playing_entry_changed (RBPlayOrder *porder,
 static void rb_queue_play_order_playing_entry_removed (RBPlayOrder *porder,
                                                       RhythmDBEntry *entry);
 
-G_DEFINE_TYPE (RBQueuePlayOrder, rb_queue_play_order, RB_TYPE_PLAY_ORDER)
-#define RB_QUEUE_PLAY_ORDER_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), 
RB_TYPE_QUEUE_PLAY_ORDER, RBQueuePlayOrderPrivate))
-
 typedef struct _RBQueuePlayOrderPrivate RBQueuePlayOrderPrivate;
 
 struct _RBQueuePlayOrderPrivate
@@ -53,6 +50,9 @@ struct _RBQueuePlayOrderPrivate
        gboolean playing_entry_removed;
 };
 
+G_DEFINE_TYPE_WITH_CODE (RBQueuePlayOrder, rb_queue_play_order, RB_TYPE_PLAY_ORDER, G_ADD_PRIVATE 
(RBQueuePlayOrder))
+#define RB_QUEUE_PLAY_ORDER_GET_PRIVATE(object) (rb_queue_play_order_get_instance_private 
(RB_QUEUE_PLAY_ORDER (object)))
+
 RBPlayOrder *
 rb_queue_play_order_new (RBShellPlayer *player)
 {
@@ -74,8 +74,6 @@ rb_queue_play_order_class_init (RBQueuePlayOrderClass *klass)
        porder->get_previous = rb_queue_play_order_get_previous;
        porder->playing_entry_changed = rb_queue_play_order_playing_entry_changed;
        porder->playing_entry_removed = rb_queue_play_order_playing_entry_removed;
-
-       g_type_class_add_private (klass, sizeof (RBQueuePlayOrderPrivate));
 }
 
 static void
diff --git a/shell/rb-play-order-random.c b/shell/rb-play-order-random.c
index b0e33ba46..3edf2740d 100644
--- a/shell/rb-play-order-random.c
+++ b/shell/rb-play-order-random.c
@@ -69,15 +69,14 @@ static void rb_random_db_entry_deleted (RBPlayOrder *porder, RhythmDBEntry *entr
 static void rb_random_handle_query_model_changed (RBRandomPlayOrder *rorder);
 static void rb_random_filter_history (RBRandomPlayOrder *rorder, RhythmDBQueryModel *model);
 
-struct RBRandomPlayOrderPrivate
+struct _RBRandomPlayOrderPrivate
 {
        RBHistory *history;
 
        gboolean query_model_changed;
 };
 
-G_DEFINE_TYPE (RBRandomPlayOrder, rb_random_play_order, RB_TYPE_PLAY_ORDER)
-#define RB_RANDOM_PLAY_ORDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_RANDOM_PLAY_ORDER, 
RBRandomPlayOrderPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBRandomPlayOrder, rb_random_play_order, RB_TYPE_PLAY_ORDER, G_ADD_PRIVATE 
(RBRandomPlayOrder))
 
 static void
 rb_random_play_order_class_init (RBRandomPlayOrderClass *klass)
@@ -100,14 +99,12 @@ rb_random_play_order_class_init (RBRandomPlayOrderClass *klass)
        porder->go_next = rb_random_play_order_go_next;
        porder->get_previous = rb_random_play_order_get_previous;
        porder->go_previous = rb_random_play_order_go_previous;
-
-       g_type_class_add_private (klass, sizeof (RBRandomPlayOrderPrivate));
 }
 
 static void
 rb_random_play_order_init (RBRandomPlayOrder *rorder)
 {
-       rorder->priv = RB_RANDOM_PLAY_ORDER_GET_PRIVATE (rorder);
+       rorder->priv = rb_random_play_order_get_instance_private (rorder);
 
        rorder->priv->history = rb_history_new (TRUE,
                                                (GFunc) rhythmdb_entry_unref,
diff --git a/shell/rb-play-order-random.h b/shell/rb-play-order-random.h
index b2260ce48..7e36ea44f 100644
--- a/shell/rb-play-order-random.h
+++ b/shell/rb-play-order-random.h
@@ -44,7 +44,7 @@ G_BEGIN_DECLS
 typedef struct _RBRandomPlayOrder RBRandomPlayOrder;
 typedef struct _RBRandomPlayOrderClass RBRandomPlayOrderClass;
 
-typedef struct RBRandomPlayOrderPrivate RBRandomPlayOrderPrivate;
+typedef struct _RBRandomPlayOrderPrivate RBRandomPlayOrderPrivate;
 
 struct _RBRandomPlayOrder
 {
diff --git a/shell/rb-play-order-shuffle.c b/shell/rb-play-order-shuffle.c
index b55fcc028..b856868b2 100644
--- a/shell/rb-play-order-shuffle.c
+++ b/shell/rb-play-order-shuffle.c
@@ -73,8 +73,7 @@ struct RBShufflePlayOrderPrivate
        RhythmDBEntry *external_playing_entry;
 };
 
-G_DEFINE_TYPE (RBShufflePlayOrder, rb_shuffle_play_order, RB_TYPE_PLAY_ORDER)
-#define RB_SHUFFLE_PLAY_ORDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SHUFFLE_PLAY_ORDER, 
RBShufflePlayOrderPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBShufflePlayOrder, rb_shuffle_play_order, RB_TYPE_PLAY_ORDER, G_ADD_PRIVATE 
(RBShufflePlayOrder))
 
 RBPlayOrder *
 rb_shuffle_play_order_new (RBShellPlayer *player)
@@ -112,14 +111,12 @@ rb_shuffle_play_order_class_init (RBShufflePlayOrderClass *klass)
        porder->go_next = rb_shuffle_play_order_go_next;
        porder->get_previous = rb_shuffle_play_order_get_previous;
        porder->go_previous = rb_shuffle_play_order_go_previous;
-
-       g_type_class_add_private (klass, sizeof (RBShufflePlayOrderPrivate));
 }
 
 static void
 rb_shuffle_play_order_init (RBShufflePlayOrder *sorder)
 {
-       sorder->priv = RB_SHUFFLE_PLAY_ORDER_GET_PRIVATE (sorder);
+       sorder->priv = rb_shuffle_play_order_get_instance_private (sorder);
 
        sorder->priv->history = rb_history_new (FALSE,
                                                (GFunc) rhythmdb_entry_unref,
diff --git a/shell/rb-play-order.c b/shell/rb-play-order.c
index 577fba5af..aa2ff86ab 100644
--- a/shell/rb-play-order.c
+++ b/shell/rb-play-order.c
@@ -98,8 +98,6 @@ struct RBPlayOrderPrivate
        gboolean have_previous;
 };
 
-#define RB_PLAY_ORDER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_PLAY_ORDER, 
RBPlayOrderPrivate))
-
 enum
 {
        PROP_0,
@@ -115,7 +113,7 @@ enum
 
 static guint rb_play_order_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBPlayOrder, rb_play_order, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBPlayOrder, rb_play_order, G_TYPE_OBJECT, G_ADD_PRIVATE (RBPlayOrder))
 
 static void
 rb_play_order_class_init (RBPlayOrderClass *klass)
@@ -175,14 +173,12 @@ rb_play_order_class_init (RBPlayOrderClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              2, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
-
-       g_type_class_add_private (klass, sizeof (RBPlayOrderPrivate));
 }
 
 static void
 rb_play_order_init (RBPlayOrder *porder)
 {
-       porder->priv = RB_PLAY_ORDER_GET_PRIVATE (porder);
+       porder->priv = rb_play_order_get_instance_private (porder);
 }
 
 static void
diff --git a/shell/rb-playlist-manager.c b/shell/rb-playlist-manager.c
index c4809a6ce..0102bcf20 100644
--- a/shell/rb-playlist-manager.c
+++ b/shell/rb-playlist-manager.c
@@ -169,7 +169,7 @@ static RBPlaylistExportFilter playlist_formats[] = {
 };
 
 
-G_DEFINE_TYPE (RBPlaylistManager, rb_playlist_manager, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBPlaylistManager, rb_playlist_manager, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RBPlaylistManager))
 
 
 /**
@@ -1900,10 +1900,7 @@ rb_playlist_manager_constructed (GObject *object)
 static void
 rb_playlist_manager_init (RBPlaylistManager *mgr)
 {
-       mgr->priv = G_TYPE_INSTANCE_GET_PRIVATE (mgr,
-                                                RB_TYPE_PLAYLIST_MANAGER,
-                                                RBPlaylistManagerPrivate);
-
+       mgr->priv = rb_playlist_manager_get_instance_private (mgr);
        mgr->priv->dirty = 0;
        mgr->priv->saving = 0;
 }
@@ -2051,6 +2048,4 @@ rb_playlist_manager_class_init (RBPlaylistManagerClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              0, G_TYPE_NONE);
-
-       g_type_class_add_private (klass, sizeof (RBPlaylistManagerPrivate));
 }
diff --git a/shell/rb-removable-media-manager.c b/shell/rb-removable-media-manager.c
index a0d4034f5..8a5efc427 100644
--- a/shell/rb-removable-media-manager.c
+++ b/shell/rb-removable-media-manager.c
@@ -115,8 +115,8 @@ typedef struct
 #endif
 } RBRemovableMediaManagerPrivate;
 
-G_DEFINE_TYPE (RBRemovableMediaManager, rb_removable_media_manager, G_TYPE_OBJECT)
-#define GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_REMOVABLE_MEDIA_MANAGER, 
RBRemovableMediaManagerPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBRemovableMediaManager, rb_removable_media_manager, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RBRemovableMediaManager))
+#define GET_PRIVATE(o)   (rb_removable_media_manager_get_instance_private (RB_REMOVABLE_MEDIA_MANAGER (o)))
 
 enum
 {
@@ -260,8 +260,6 @@ rb_removable_media_manager_class_init (RBRemovableMediaManagerClass *klass)
                              NULL,
                              RB_TYPE_SOURCE,
                              2, G_TYPE_MOUNT, MPID_TYPE_DEVICE);
-
-       g_type_class_add_private (klass, sizeof (RBRemovableMediaManagerPrivate));
 }
 
 static guint
diff --git a/shell/rb-shell-clipboard.c b/shell/rb-shell-clipboard.c
index 725135d29..e5283d581 100644
--- a/shell/rb-shell-clipboard.c
+++ b/shell/rb-shell-clipboard.c
@@ -117,8 +117,6 @@ struct RBShellClipboardPrivate
        GMenuModel *playlist_menu;
 };
 
-#define RB_SHELL_CLIPBOARD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SHELL_CLIPBOARD, 
RBShellClipboardPrivate))
-
 enum
 {
        PROP_0,
@@ -128,7 +126,7 @@ enum
 };
 
 
-G_DEFINE_TYPE (RBShellClipboard, rb_shell_clipboard, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBShellClipboard, rb_shell_clipboard, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RBShellClipboard))
 
 static void
 rb_shell_clipboard_class_init (RBShellClipboardClass *klass)
@@ -163,14 +161,12 @@ rb_shell_clipboard_class_init (RBShellClipboardClass *klass)
                                                              "RBPlaylistSource object",
                                                              RB_TYPE_PLAYLIST_SOURCE,
                                                              G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RBShellClipboardPrivate));
 }
 
 static void
 rb_shell_clipboard_init (RBShellClipboard *shell_clipboard)
 {
-       shell_clipboard->priv = RB_SHELL_CLIPBOARD_GET_PRIVATE (shell_clipboard);
+       shell_clipboard->priv = rb_shell_clipboard_get_instance_private (shell_clipboard);
 
        shell_clipboard->priv->signal_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                                                    NULL, g_free);
diff --git a/shell/rb-shell-player.c b/shell/rb-shell-player.c
index 4f7ab0a36..08edfa0df 100644
--- a/shell/rb-shell-player.c
+++ b/shell/rb-shell-player.c
@@ -236,8 +236,6 @@ struct RBShellPlayerPrivate
        guint error_idle_id;
 };
 
-#define RB_SHELL_PLAYER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SHELL_PLAYER, 
RBShellPlayerPrivate))
-
 enum
 {
        PROP_0,
@@ -274,7 +272,7 @@ enum
 
 static guint rb_shell_player_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBShellPlayer, rb_shell_player, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBShellPlayer, rb_shell_player, G_TYPE_OBJECT, G_ADD_PRIVATE (RBShellPlayer))
 
 static void
 volume_pre_unmount_cb (GVolumeMonitor *monitor,
@@ -3271,7 +3269,7 @@ rb_shell_player_init (RBShellPlayer *player)
 {
        GError *error = NULL;
 
-       player->priv = RB_SHELL_PLAYER_GET_PRIVATE (player);
+       player->priv = rb_shell_player_get_instance_private (player);
 
        g_mutex_init (&player->priv->error_idle_mutex);
 
@@ -3763,8 +3761,6 @@ rb_shell_player_class_init (RBShellPlayerClass *klass)
                              G_TYPE_NONE,
                              1,
                              G_TYPE_INT64);
-
-       g_type_class_add_private (klass, sizeof (RBShellPlayerPrivate));
 }
 
 /**
diff --git a/shell/rb-shell-preferences.c b/shell/rb-shell-preferences.c
index e7d9062e4..fe0492e4e 100644
--- a/shell/rb-shell-preferences.c
+++ b/shell/rb-shell-preferences.c
@@ -134,7 +134,7 @@ struct RBShellPreferencesPrivate
 };
 
 
-G_DEFINE_TYPE (RBShellPreferences, rb_shell_preferences, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (RBShellPreferences, rb_shell_preferences, GTK_TYPE_DIALOG, G_ADD_PRIVATE 
(RBShellPreferences))
 
 static void
 rb_shell_preferences_class_init (RBShellPreferencesClass *klass)
@@ -143,8 +143,6 @@ rb_shell_preferences_class_init (RBShellPreferencesClass *klass)
 
        object_class->finalize = impl_finalize;
        object_class->dispose = impl_dispose;
-
-       g_type_class_add_private (klass, sizeof (RBShellPreferencesPrivate));
 }
 
 static void
@@ -176,9 +174,7 @@ rb_shell_preferences_init (RBShellPreferences *shell_preferences)
        GtkBuilder *builder;
        int i;
 
-       shell_preferences->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell_preferences,
-                                                              RB_TYPE_SHELL_PREFERENCES,
-                                                              RBShellPreferencesPrivate);
+       shell_preferences->priv = rb_shell_preferences_get_instance_private (shell_preferences);
 
        g_signal_connect_object (shell_preferences,
                                 "delete_event",
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index 24e68f426..83c462913 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -224,7 +224,6 @@ enum
 
 static guint rb_shell_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBShell, rb_shell, G_TYPE_OBJECT)
 
 struct _RBShellPrivate
 {
@@ -305,6 +304,8 @@ struct _RBShellPrivate
        RBTaskList *task_list;
 };
 
+G_DEFINE_TYPE_WITH_CODE (RBShell, rb_shell, G_TYPE_OBJECT, G_ADD_PRIVATE (RBShell))
+
 static GMountOperation *
 rb_shell_create_mount_op_cb (RhythmDB *db, RBShell *shell)
 {
@@ -1396,13 +1397,12 @@ rb_shell_class_init (RBShellClass *klass)
                              G_TYPE_NONE,
                              5,
                              G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
-       g_type_class_add_private (klass, sizeof (RBShellPrivate));
 }
 
 static void
 rb_shell_init (RBShell *shell)
 {
-       shell->priv = G_TYPE_INSTANCE_GET_PRIVATE (shell, RB_TYPE_SHELL, RBShellPrivate);
+       shell->priv = rb_shell_get_instance_private (shell);
 }
 
 static void
diff --git a/shell/rb-track-transfer-batch.c b/shell/rb-track-transfer-batch.c
index 107cb414c..a7716a103 100644
--- a/shell/rb-track-transfer-batch.c
+++ b/shell/rb-track-transfer-batch.c
@@ -125,6 +125,7 @@ G_DEFINE_TYPE_EXTENDED (RBTrackTransferBatch,
                        rb_track_transfer_batch,
                        G_TYPE_OBJECT,
                        0,
+                       G_ADD_PRIVATE (RBTrackTransferBatch)
                        G_IMPLEMENT_INTERFACE (RB_TYPE_TASK_PROGRESS, 
rb_track_transfer_batch_task_progress_init));
 
 /**
@@ -789,9 +790,7 @@ start_next (RBTrackTransferBatch *batch)
 static void
 rb_track_transfer_batch_init (RBTrackTransferBatch *batch)
 {
-       batch->priv = G_TYPE_INSTANCE_GET_PRIVATE (batch,
-                                                  RB_TYPE_TRACK_TRANSFER_BATCH,
-                                                  RBTrackTransferBatchPrivate);
+       batch->priv = rb_track_transfer_batch_get_instance_private (batch);
 }
 
 static void
@@ -1263,6 +1262,4 @@ rb_track_transfer_batch_class_init (RBTrackTransferBatchClass *klass)
                              NULL, NULL, NULL,
                              G_TYPE_NONE,
                              5, RHYTHMDB_TYPE_ENTRY, G_TYPE_STRING, G_TYPE_UINT64, G_TYPE_STRING, 
G_TYPE_POINTER);
-
-       g_type_class_add_private (klass, sizeof (RBTrackTransferBatchPrivate));
 }
diff --git a/shell/rb-track-transfer-queue.c b/shell/rb-track-transfer-queue.c
index d5f9de00a..ffb833864 100644
--- a/shell/rb-track-transfer-queue.c
+++ b/shell/rb-track-transfer-queue.c
@@ -77,7 +77,7 @@ struct _RBTrackTransferQueuePrivate
        time_t current_start_time;
 };
 
-G_DEFINE_TYPE (RBTrackTransferQueue, rb_track_transfer_queue, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBTrackTransferQueue, rb_track_transfer_queue, G_TYPE_OBJECT, G_ADD_PRIVATE 
(RBTrackTransferQueue))
 
 /**
  * SECTION:rb-track-transfer-queue
@@ -624,10 +624,7 @@ rb_track_transfer_queue_cancel_for_source (RBTrackTransferQueue *queue, RBSource
 static void
 rb_track_transfer_queue_init (RBTrackTransferQueue *queue)
 {
-       queue->priv = G_TYPE_INSTANCE_GET_PRIVATE (queue,
-                                                  RB_TYPE_TRACK_TRANSFER_QUEUE,
-                                                  RBTrackTransferQueuePrivate);
-
+       queue->priv = rb_track_transfer_queue_get_instance_private (queue);
        queue->priv->batch_queue = g_queue_new ();
 }
 
@@ -771,6 +768,4 @@ rb_track_transfer_queue_class_init (RBTrackTransferQueueClass *klass)
                              G_TYPE_BOOLEAN,
                              3,
                              G_TYPE_STRV, G_TYPE_STRV, G_TYPE_CLOSURE);
-
-       g_type_class_add_private (klass, sizeof (RBTrackTransferQueuePrivate));
 }
diff --git a/sources/rb-auto-playlist-source.c b/sources/rb-auto-playlist-source.c
index 0d84f929f..32b355ee9 100644
--- a/sources/rb-auto-playlist-source.c
+++ b/sources/rb-auto-playlist-source.c
@@ -128,8 +128,8 @@ struct _RBAutoPlaylistSourcePrivate
        GAction *search_action;
 };
 
-G_DEFINE_TYPE (RBAutoPlaylistSource, rb_auto_playlist_source, RB_TYPE_PLAYLIST_SOURCE)
-#define GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), RB_TYPE_AUTO_PLAYLIST_SOURCE, 
RBAutoPlaylistSourcePrivate))
+G_DEFINE_TYPE_WITH_CODE (RBAutoPlaylistSource, rb_auto_playlist_source, RB_TYPE_PLAYLIST_SOURCE, 
G_ADD_PRIVATE (RBAutoPlaylistSource))
+#define GET_PRIVATE(object) (rb_auto_playlist_source_get_instance_private (RB_AUTO_PLAYLIST_SOURCE (object)))
 
 static void
 rb_auto_playlist_source_class_init (RBAutoPlaylistSourceClass *klass)
@@ -157,8 +157,6 @@ rb_auto_playlist_source_class_init (RBAutoPlaylistSourceClass *klass)
 
        g_object_class_override_property (object_class, PROP_BASE_QUERY_MODEL, "base-query-model");
        g_object_class_override_property (object_class, PROP_SHOW_BROWSER, "show-browser");
-
-       g_type_class_add_private (klass, sizeof (RBAutoPlaylistSourcePrivate));
 }
 
 static void
diff --git a/sources/rb-browser-source.c b/sources/rb-browser-source.c
index d916ab7d7..4eb2c451c 100644
--- a/sources/rb-browser-source.c
+++ b/sources/rb-browser-source.c
@@ -130,8 +130,6 @@ struct RBBrowserSourcePrivate
        GAction *search_action;
 };
 
-#define RB_BROWSER_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_BROWSER_SOURCE, 
RBBrowserSourcePrivate))
-
 static const GtkTargetEntry songs_view_drag_types[] = {
        { "application/x-rhythmbox-entry", 0, 0 },
        { "text/uri-list", 0, 1 }
@@ -145,7 +143,7 @@ enum
        PROP_SHOW_BROWSER
 };
 
-G_DEFINE_ABSTRACT_TYPE (RBBrowserSource, rb_browser_source, RB_TYPE_SOURCE)
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (RBBrowserSource, rb_browser_source, RB_TYPE_SOURCE, G_ADD_PRIVATE 
(RBBrowserSource))
 
 static void
 rb_browser_source_class_init (RBBrowserSourceClass *klass)
@@ -191,14 +189,12 @@ rb_browser_source_class_init (RBBrowserSourceClass *klass)
        g_object_class_override_property (object_class,
                                          PROP_SHOW_BROWSER,
                                          "show-browser");
-
-       g_type_class_add_private (klass, sizeof (RBBrowserSourcePrivate));
 }
 
 static void
 rb_browser_source_init (RBBrowserSource *source)
 {
-       source->priv = RB_BROWSER_SOURCE_GET_PRIVATE (source);
+       source->priv = rb_browser_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/rb-display-page-group.c b/sources/rb-display-page-group.c
index c46789ac8..bbd5958b1 100644
--- a/sources/rb-display-page-group.c
+++ b/sources/rb-display-page-group.c
@@ -67,7 +67,7 @@ struct _RBDisplayPageGroupPrivate
        gboolean loaded;
 };
 
-G_DEFINE_TYPE (RBDisplayPageGroup, rb_display_page_group, RB_TYPE_DISPLAY_PAGE)
+G_DEFINE_TYPE_WITH_CODE (RBDisplayPageGroup, rb_display_page_group, RB_TYPE_DISPLAY_PAGE, G_ADD_PRIVATE 
(RBDisplayPageGroup))
 
 static GHashTable *display_page_groups_map;
 
@@ -286,9 +286,7 @@ impl_constructed (GObject *object)
 static void
 rb_display_page_group_init (RBDisplayPageGroup *group)
 {
-       group->priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
-                                                  RB_TYPE_DISPLAY_PAGE_GROUP,
-                                                  RBDisplayPageGroupPrivate);
+       group->priv = rb_display_page_group_get_instance_private (group);
 }
 
 static void
@@ -348,6 +346,4 @@ rb_display_page_group_class_init (RBDisplayPageGroupClass *klass)
                                                               "Whether the group is loaded",
                                                               FALSE,
                                                               G_PARAM_READABLE));
-
-       g_type_class_add_private (klass, sizeof (RBDisplayPageGroupPrivate));
 }
diff --git a/sources/rb-display-page-menu.c b/sources/rb-display-page-menu.c
index 051b1d9e9..2f61935be 100644
--- a/sources/rb-display-page-menu.c
+++ b/sources/rb-display-page-menu.c
@@ -46,7 +46,7 @@ struct _RBDisplayPageMenuPrivate
        int item_count;
 };
 
-G_DEFINE_TYPE (RBDisplayPageMenu, rb_display_page_menu, G_TYPE_MENU_MODEL);
+G_DEFINE_TYPE_WITH_CODE (RBDisplayPageMenu, rb_display_page_menu, G_TYPE_MENU_MODEL, G_ADD_PRIVATE 
(RBDisplayPageMenu));
 
 /**
  * SECTION:rb-display-page-menu
@@ -441,7 +441,7 @@ impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp
 static void
 rb_display_page_menu_init (RBDisplayPageMenu *menu)
 {
-       menu->priv = G_TYPE_INSTANCE_GET_PRIVATE (menu, RB_TYPE_DISPLAY_PAGE_MENU, RBDisplayPageMenuPrivate);
+       menu->priv = rb_display_page_menu_get_instance_private (menu);
 }
 
 static void
@@ -492,8 +492,6 @@ rb_display_page_menu_class_init (RBDisplayPageMenuClass *klass)
                                                              "action name",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBDisplayPageMenuPrivate));
 }
 
 
diff --git a/sources/rb-display-page-tree.c b/sources/rb-display-page-tree.c
index e73f0fc10..56efc7b80 100644
--- a/sources/rb-display-page-tree.c
+++ b/sources/rb-display-page-tree.c
@@ -116,7 +116,7 @@ enum
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBDisplayPageTree, rb_display_page_tree, GTK_TYPE_GRID)
+G_DEFINE_TYPE_WITH_CODE (RBDisplayPageTree, rb_display_page_tree, GTK_TYPE_GRID, G_ADD_PRIVATE 
(RBDisplayPageTree))
 
 static RBDisplayPage *
 get_selected_page (RBDisplayPageTree *display_page_tree)
@@ -1019,10 +1019,7 @@ impl_constructed (GObject *object)
 static void
 rb_display_page_tree_init (RBDisplayPageTree *display_page_tree)
 {
-       display_page_tree->priv =
-               G_TYPE_INSTANCE_GET_PRIVATE (display_page_tree,
-                                            RB_TYPE_DISPLAY_PAGE_TREE,
-                                            RBDisplayPageTreePrivate);
+       display_page_tree->priv = rb_display_page_tree_get_instance_private (display_page_tree);
 }
 
 static void
@@ -1099,6 +1096,4 @@ rb_display_page_tree_class_init (RBDisplayPageTreeClass *class)
                              G_TYPE_NONE,
                              2,
                              G_TYPE_POINTER, G_TYPE_POINTER);
-
-       g_type_class_add_private (class, sizeof (RBDisplayPageTreePrivate));
 }
diff --git a/sources/rb-display-page.c b/sources/rb-display-page.c
index ebc7f8ff7..953ab36fb 100644
--- a/sources/rb-display-page.c
+++ b/sources/rb-display-page.c
@@ -33,7 +33,6 @@
 #include "rb-debug.h"
 #include "rb-util.h"
 
-G_DEFINE_ABSTRACT_TYPE (RBDisplayPage, rb_display_page, GTK_TYPE_BOX)
 
 /**
  * SECTION:rb-display-page
@@ -67,6 +66,8 @@ struct _RBDisplayPagePrivate
        GList *pending_children;
 };
 
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (RBDisplayPage, rb_display_page, GTK_TYPE_BOX, G_ADD_PRIVATE 
(RBDisplayPage))
+
 enum
 {
        PROP_0,
@@ -564,7 +565,7 @@ static void
 rb_display_page_init (RBDisplayPage *page)
 {
        gtk_orientable_set_orientation (GTK_ORIENTABLE (page), GTK_ORIENTATION_HORIZONTAL);
-       page->priv = G_TYPE_INSTANCE_GET_PRIVATE (page, RB_TYPE_DISPLAY_PAGE, RBDisplayPagePrivate);
+       page->priv = rb_display_page_get_instance_private (page);
 
        page->priv->visible = TRUE;
 }
@@ -698,6 +699,4 @@ rb_display_page_class_init (RBDisplayPageClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              0);
-
-       g_type_class_add_private (object_class, sizeof (RBDisplayPagePrivate));
 }
diff --git a/sources/rb-import-errors-source.c b/sources/rb-import-errors-source.c
index 5c916d478..0f1dd334e 100644
--- a/sources/rb-import-errors-source.c
+++ b/sources/rb-import-errors-source.c
@@ -82,7 +82,7 @@ struct _RBImportErrorsSourcePrivate
        GMenuModel *popup;
 };
 
-G_DEFINE_TYPE (RBImportErrorsSource, rb_import_errors_source, RB_TYPE_SOURCE);
+G_DEFINE_TYPE_WITH_CODE (RBImportErrorsSource, rb_import_errors_source, RB_TYPE_SOURCE, G_ADD_PRIVATE 
(RBImportErrorsSource));
 
 /**
  * SECTION:rb-import-errors-source
@@ -149,14 +149,12 @@ rb_import_errors_source_class_init (RBImportErrorsSourceClass *klass)
                                                              "Entry type for entries of this type to be 
ignored",
                                                              RHYTHMDB_TYPE_ENTRY_TYPE,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBImportErrorsSourcePrivate));
 }
 
 static void
 rb_import_errors_source_init (RBImportErrorsSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source, RB_TYPE_IMPORT_ERRORS_SOURCE, 
RBImportErrorsSourcePrivate);
+       source->priv = rb_import_errors_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index 536726f37..648f76968 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -165,8 +165,7 @@ struct RBLibrarySourcePrivate
        GSettings *encoding_settings;
 };
 
-#define RB_LIBRARY_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_LIBRARY_SOURCE, 
RBLibrarySourcePrivate))
-G_DEFINE_TYPE (RBLibrarySource, rb_library_source, RB_TYPE_BROWSER_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (RBLibrarySource, rb_library_source, RB_TYPE_BROWSER_SOURCE, G_ADD_PRIVATE 
(RBLibrarySource))
 
 static void
 rb_library_source_class_init (RBLibrarySourceClass *klass)
@@ -191,14 +190,12 @@ rb_library_source_class_init (RBLibrarySourceClass *klass)
 
        browser_source_class->has_drop_support = (RBBrowserSourceFeatureFunc) rb_true_function;
        browser_source_class->pack_content = impl_pack_content;
-
-       g_type_class_add_private (klass, sizeof (RBLibrarySourcePrivate));
 }
 
 static void
 rb_library_source_init (RBLibrarySource *source)
 {
-       source->priv = RB_LIBRARY_SOURCE_GET_PRIVATE (source);
+       source->priv = rb_library_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/rb-media-player-source.c b/sources/rb-media-player-source.c
index cb8eade20..fb03c0df9 100644
--- a/sources/rb-media-player-source.c
+++ b/sources/rb-media-player-source.c
@@ -77,12 +77,12 @@ typedef struct {
        GSettings *encoding_settings;
 } RBMediaPlayerSourcePrivate;
 
-G_DEFINE_TYPE (RBMediaPlayerSource, rb_media_player_source, RB_TYPE_BROWSER_SOURCE);
+G_DEFINE_TYPE_WITH_CODE (RBMediaPlayerSource, rb_media_player_source, RB_TYPE_BROWSER_SOURCE, G_ADD_PRIVATE 
(RBMediaPlayerSource));
 
-G_DEFINE_TYPE (RBMediaPlayerEntryType, rb_media_player_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
+G_DEFINE_TYPE_WITH_CODE (RBMediaPlayerEntryType, rb_media_player_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE, 
G_ADD_PRIVATE (RBMediaPlayerEntryType));
 
-#define MEDIA_PLAYER_SOURCE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_MEDIA_PLAYER_SOURCE, 
RBMediaPlayerSourcePrivate))
-#define MEDIA_PLAYER_ENTRY_TYPE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
RB_TYPE_MEDIA_PLAYER_ENTRY_TYPE, RBMediaPlayerEntryTypePrivate))
+#define MEDIA_PLAYER_SOURCE_GET_PRIVATE(o)   (rb_media_player_source_get_instance_private 
(RB_MEDIA_PLAYER_SOURCE (o)))
+#define MEDIA_PLAYER_ENTRY_TYPE_GET_PRIVATE(o)   (rb_media_player_entry_type_get_instance_private 
(RB_MEDIA_PLAYER_ENTRY_TYPE (o)))
 
 static void rb_media_player_entry_type_class_init (RBMediaPlayerEntryTypeClass *klass);
 static void rb_media_player_entry_type_init (RBMediaPlayerEntryType *etype);
@@ -223,8 +223,6 @@ rb_media_player_entry_type_class_init (RBMediaPlayerEntryTypeClass *klass)
                                                              "uri prefix for entries",
                                                              NULL,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBMediaPlayerEntryTypePrivate));
 }
 
 static void
@@ -295,8 +293,6 @@ rb_media_player_source_class_init (RBMediaPlayerSourceClass *klass)
                                                              "GSettings holding encoding settings",
                                                              G_TYPE_SETTINGS,
                                                              G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RBMediaPlayerSourcePrivate));
 }
 
 static void
diff --git a/sources/rb-missing-files-source.c b/sources/rb-missing-files-source.c
index 9fc39c0fe..30caa0ade 100644
--- a/sources/rb-missing-files-source.c
+++ b/sources/rb-missing-files-source.c
@@ -84,7 +84,7 @@ struct RBMissingFilesSourcePrivate
        GMenuModel *popup;
 };
 
-G_DEFINE_TYPE (RBMissingFilesSource, rb_missing_files_source, RB_TYPE_SOURCE);
+G_DEFINE_TYPE_WITH_CODE (RBMissingFilesSource, rb_missing_files_source, RB_TYPE_SOURCE, G_ADD_PRIVATE 
(RBMissingFilesSource));
 
 static void
 rb_missing_files_source_class_init (RBMissingFilesSourceClass *klass)
@@ -115,14 +115,12 @@ rb_missing_files_source_class_init (RBMissingFilesSourceClass *klass)
        source_class->song_properties = impl_song_properties;
        source_class->try_playlist = (RBSourceFeatureFunc) rb_false_function;
        source_class->can_pause = (RBSourceFeatureFunc) rb_false_function;
-
-       g_type_class_add_private (klass, sizeof (RBMissingFilesSourcePrivate));
 }
 
 static void
 rb_missing_files_source_init (RBMissingFilesSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source, RB_TYPE_MISSING_FILES_SOURCE, 
RBMissingFilesSourcePrivate);
+       source->priv = rb_missing_files_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/rb-play-queue-source.c b/sources/rb-play-queue-source.c
index e847aa647..65422255b 100644
--- a/sources/rb-play-queue-source.c
+++ b/sources/rb-play-queue-source.c
@@ -137,8 +137,8 @@ enum
        PROP_PLAY_ORDER
 };
 
-G_DEFINE_TYPE (RBPlayQueueSource, rb_play_queue_source, RB_TYPE_STATIC_PLAYLIST_SOURCE)
-#define RB_PLAY_QUEUE_SOURCE_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), 
RB_TYPE_PLAY_QUEUE_SOURCE, RBPlayQueueSourcePrivate))
+G_DEFINE_TYPE_WITH_CODE (RBPlayQueueSource, rb_play_queue_source, RB_TYPE_STATIC_PLAYLIST_SOURCE, 
G_ADD_PRIVATE (RBPlayQueueSource))
+#define RB_PLAY_QUEUE_SOURCE_GET_PRIVATE(object) (rb_play_queue_source_get_instance_private 
(RB_PLAY_QUEUE_SOURCE (object)))
 
 static const GDBusInterfaceVTable play_queue_vtable = {
        (GDBusInterfaceMethodCallFunc) rb_play_queue_dbus_method_call,
@@ -230,8 +230,6 @@ rb_play_queue_source_class_init (RBPlayQueueSourceClass *klass)
        g_object_class_override_property (object_class,
                                          PROP_PLAY_ORDER,
                                          "play-order");
-
-       g_type_class_add_private (klass, sizeof (RBPlayQueueSourcePrivate));
 }
 
 static void
diff --git a/sources/rb-playlist-source.c b/sources/rb-playlist-source.c
index 0d6124ad9..0c06be9cb 100644
--- a/sources/rb-playlist-source.c
+++ b/sources/rb-playlist-source.c
@@ -142,8 +142,6 @@ struct RBPlaylistSourcePrivate
        GMenu *popup;
 };
 
-#define RB_PLAYLIST_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_PLAYLIST_SOURCE, 
RBPlaylistSourcePrivate))
-
 enum
 {
        PROP_0,
@@ -156,7 +154,7 @@ static const GtkTargetEntry target_uri [] = { { "text/uri-list", 0, 0 } };
 
 static GSettingsBackend *playlist_settings_backend = NULL;
 
-G_DEFINE_ABSTRACT_TYPE (RBPlaylistSource, rb_playlist_source, RB_TYPE_SOURCE);
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (RBPlaylistSource, rb_playlist_source, RB_TYPE_SOURCE, G_ADD_PRIVATE 
(RBPlaylistSource));
 
 static void
 rb_playlist_source_class_init (RBPlaylistSourceClass *klass)
@@ -225,14 +223,12 @@ rb_playlist_source_class_init (RBPlaylistSourceClass *klass)
                                                               "whether this playlist is attached to the 
local library",
                                                               TRUE,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBPlaylistSourcePrivate));
 }
 
 static void
 rb_playlist_source_init (RBPlaylistSource *source)
 {
-       source->priv = RB_PLAYLIST_SOURCE_GET_PRIVATE (source);
+       source->priv = rb_playlist_source_get_instance_private (source);
        
        if (playlist_settings_backend == NULL) {
                playlist_settings_backend = g_memory_settings_backend_new ();
diff --git a/sources/rb-source.c b/sources/rb-source.c
index fd977524b..16a50970b 100644
--- a/sources/rb-source.c
+++ b/sources/rb-source.c
@@ -80,7 +80,6 @@ static void rb_source_row_inserted_cb (GtkTreeModel *model,
                                       GtkTreeIter *iter,
                                       RBSource *source);
 
-G_DEFINE_ABSTRACT_TYPE (RBSource, rb_source, RB_TYPE_DISPLAY_PAGE)
 
 /**
  * SECTION:rb-source
@@ -118,6 +117,8 @@ struct _RBSourcePrivate
        GMenuModel *playlist_menu;
 };
 
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (RBSource, rb_source, RB_TYPE_DISPLAY_PAGE, G_ADD_PRIVATE (RBSource))
+
 enum
 {
        PROP_0,
@@ -361,14 +362,12 @@ rb_source_class_init (RBSourceClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              0);
-
-       g_type_class_add_private (object_class, sizeof (RBSourcePrivate));
 }
 
 static void
 rb_source_init (RBSource *source)
 {
-       source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source, RB_TYPE_SOURCE, RBSourcePrivate);
+       source->priv = rb_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/rb-static-playlist-source.c b/sources/rb-static-playlist-source.c
index 4c60f7044..52be2b56d 100644
--- a/sources/rb-static-playlist-source.c
+++ b/sources/rb-static-playlist-source.c
@@ -126,11 +126,6 @@ enum
        PROP_SHOW_BROWSER
 };
 
-G_DEFINE_TYPE (RBStaticPlaylistSource, rb_static_playlist_source, RB_TYPE_PLAYLIST_SOURCE)
-#define RB_STATIC_PLAYLIST_SOURCE_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
-                                                               RB_TYPE_STATIC_PLAYLIST_SOURCE, \
-                                                               RBStaticPlaylistSourcePrivate))
-
 typedef struct
 {
        RhythmDBQueryModel *base_model;
@@ -146,6 +141,9 @@ typedef struct
 
 } RBStaticPlaylistSourcePrivate;
 
+G_DEFINE_TYPE_WITH_CODE (RBStaticPlaylistSource, rb_static_playlist_source, RB_TYPE_PLAYLIST_SOURCE, 
G_ADD_PRIVATE (RBStaticPlaylistSource))
+#define RB_STATIC_PLAYLIST_SOURCE_GET_PRIVATE(object) (rb_static_playlist_source_get_instance_private 
(RB_STATIC_PLAYLIST_SOURCE (object)))
+
 static void
 rb_static_playlist_source_class_init (RBStaticPlaylistSourceClass *klass)
 {
@@ -181,8 +179,6 @@ rb_static_playlist_source_class_init (RBStaticPlaylistSourceClass *klass)
        g_object_class_override_property (object_class,
                                          PROP_SHOW_BROWSER,
                                          "show-browser");
-
-       g_type_class_add_private (klass, sizeof (RBStaticPlaylistSourcePrivate));
 }
 
 static void
diff --git a/sources/rb-streaming-source.c b/sources/rb-streaming-source.c
index cfb69e6cb..96a07663b 100644
--- a/sources/rb-streaming-source.c
+++ b/sources/rb-streaming-source.c
@@ -101,7 +101,7 @@ struct _RBStreamingSourcePrivate
        gboolean dispose_has_run;
 };
 
-G_DEFINE_TYPE (RBStreamingSource, rb_streaming_source, RB_TYPE_SOURCE)
+G_DEFINE_TYPE_WITH_CODE (RBStreamingSource, rb_streaming_source, RB_TYPE_SOURCE, G_ADD_PRIVATE 
(RBStreamingSource))
 
 static void
 rb_streaming_source_class_init (RBStreamingSourceClass *klass)
@@ -117,16 +117,12 @@ rb_streaming_source_class_init (RBStreamingSourceClass *klass)
        source_class->can_pause = (RBSourceFeatureFunc) rb_false_function;
        source_class->handle_eos = impl_handle_eos;
        source_class->try_playlist = (RBSourceFeatureFunc) rb_true_function;
-
-       g_type_class_add_private (klass, sizeof (RBStreamingSourcePrivate));
 }
 
 static void
 rb_streaming_source_init (RBStreamingSource *source)
 {
-       source->priv = (G_TYPE_INSTANCE_GET_PRIVATE ((source),
-                                                    RB_TYPE_STREAMING_SOURCE,
-                                                    RBStreamingSourcePrivate));
+       source->priv = rb_streaming_source_get_instance_private (source);
 }
 
 static void
diff --git a/sources/sync/rb-sync-settings-ui.c b/sources/sync/rb-sync-settings-ui.c
index c019682c9..ec776d042 100644
--- a/sources/sync/rb-sync-settings-ui.c
+++ b/sources/sync/rb-sync-settings-ui.c
@@ -50,7 +50,7 @@ enum {
        PROP_SYNC_SETTINGS
 };
 
-G_DEFINE_TYPE (RBSyncSettingsUI, rb_sync_settings_ui, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (RBSyncSettingsUI, rb_sync_settings_ui, GTK_TYPE_BOX, G_ADD_PRIVATE 
(RBSyncSettingsUI))
 
 
 static void
@@ -182,7 +182,7 @@ rb_sync_settings_ui_new (RBMediaPlayerSource *source, RBSyncSettings *settings)
 static void
 rb_sync_settings_ui_init (RBSyncSettingsUI *ui)
 {
-       ui->priv = G_TYPE_INSTANCE_GET_PRIVATE (ui, RB_TYPE_SYNC_SETTINGS_UI, RBSyncSettingsUIPrivate);
+       ui->priv = rb_sync_settings_ui_get_instance_private (ui);
        gtk_orientable_set_orientation (GTK_ORIENTABLE (ui), GTK_ORIENTATION_VERTICAL);
 }
 
@@ -412,6 +412,4 @@ rb_sync_settings_ui_class_init (RBSyncSettingsUIClass *klass)
                                                              "RBSyncSettings instance",
                                                              RB_TYPE_SYNC_SETTINGS,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (object_class, sizeof (RBSyncSettingsUIPrivate));
 }
diff --git a/sources/sync/rb-sync-settings.c b/sources/sync/rb-sync-settings.c
index 76841c930..fa66f2944 100644
--- a/sources/sync/rb-sync-settings.c
+++ b/sources/sync/rb-sync-settings.c
@@ -78,9 +78,9 @@ enum {
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBSyncSettings, rb_sync_settings, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBSyncSettings, rb_sync_settings, G_TYPE_OBJECT, G_ADD_PRIVATE (RBSyncSettings))
 
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SYNC_SETTINGS, RBSyncSettingsPrivate))
+#define GET_PRIVATE(o) (rb_sync_settings_get_instance_private (RB_SYNC_SETTINGS (o)))
 
 RBSyncSettings *
 rb_sync_settings_new (const char *keyfile)
@@ -439,5 +439,4 @@ rb_sync_settings_class_init (RBSyncSettingsClass *klass)
                                         NULL,
                                         G_TYPE_NONE,
                                         0);
-       g_type_class_add_private (object_class, sizeof (RBSyncSettingsPrivate));
 }
diff --git a/sources/sync/rb-sync-state-ui.c b/sources/sync/rb-sync-state-ui.c
index 48edd873d..daa9dde84 100644
--- a/sources/sync/rb-sync-state-ui.c
+++ b/sources/sync/rb-sync-state-ui.c
@@ -54,7 +54,7 @@ enum {
        PROP_SYNC_STATE
 };
 
-G_DEFINE_TYPE (RBSyncStateUI, rb_sync_state_ui, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (RBSyncStateUI, rb_sync_state_ui, GTK_TYPE_BOX, G_ADD_PRIVATE (RBSyncStateUI))
 
 
 static char *
@@ -213,7 +213,7 @@ rb_sync_state_ui_new (RBSyncState *state)
 static void
 rb_sync_state_ui_init (RBSyncStateUI *ui)
 {
-       ui->priv = G_TYPE_INSTANCE_GET_PRIVATE (ui, RB_TYPE_SYNC_STATE_UI, RBSyncStateUIPrivate);
+       ui->priv = rb_sync_state_ui_get_instance_private (ui);
        gtk_orientable_set_orientation (GTK_ORIENTABLE (ui), GTK_ORIENTATION_VERTICAL);
 }
 
@@ -317,6 +317,4 @@ rb_sync_state_ui_class_init (RBSyncStateUIClass *klass)
                                                              "RBSyncState instance",
                                                              RB_TYPE_SYNC_STATE,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (object_class, sizeof (RBSyncStateUIPrivate));
 }
diff --git a/sources/sync/rb-sync-state.c b/sources/sync/rb-sync-state.c
index d072f6a5c..5e647d2a3 100644
--- a/sources/sync/rb-sync-state.c
+++ b/sources/sync/rb-sync-state.c
@@ -57,7 +57,7 @@ enum {
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBSyncState, rb_sync_state, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_CODE (RBSyncState, rb_sync_state, G_TYPE_OBJECT, G_ADD_PRIVATE (RBSyncState))
 
 static gboolean
 entry_is_undownloaded_podcast (RhythmDBEntry *entry)
@@ -455,7 +455,7 @@ rb_sync_state_new (RBMediaPlayerSource *source, RBSyncSettings *settings)
 static void
 rb_sync_state_init (RBSyncState *state)
 {
-       state->priv = G_TYPE_INSTANCE_GET_PRIVATE (state, RB_TYPE_SYNC_STATE, RBSyncStatePrivate);
+       state->priv = rb_sync_state_get_instance_private (state);
 }
 
 static void
@@ -550,6 +550,4 @@ rb_sync_state_class_init (RBSyncStateClass *klass)
                                         NULL,
                                         G_TYPE_NONE,
                                         0);
-
-       g_type_class_add_private (object_class, sizeof (RBSyncStatePrivate));
 }
diff --git a/widgets/eggwrapbox.c b/widgets/eggwrapbox.c
index 16d598da4..c3123c3ed 100644
--- a/widgets/eggwrapbox.c
+++ b/widgets/eggwrapbox.c
@@ -147,6 +147,7 @@ static void egg_wrap_box_get_preferred_width_for_height (GtkWidget           *bo
 
 
 G_DEFINE_TYPE_WITH_CODE (EggWrapBox, egg_wrap_box, GTK_TYPE_CONTAINER,
+                        G_ADD_PRIVATE (EggWrapBox)
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
 
 
@@ -320,8 +321,6 @@ egg_wrap_box_class_init (EggWrapBoxClass *class)
                                                P_("The packing options to use for this child"),
                                                EGG_TYPE_WRAP_BOX_PACKING, 0,
                                                GTK_PARAM_READWRITE));
-
-  g_type_class_add_private (class, sizeof (EggWrapBoxPrivate));
 }
 
 static void
@@ -329,8 +328,7 @@ egg_wrap_box_init (EggWrapBox *box)
 {
   EggWrapBoxPrivate *priv;
 
-  box->priv = priv =
-    G_TYPE_INSTANCE_GET_PRIVATE (box, EGG_TYPE_WRAP_BOX, EggWrapBoxPrivate);
+  box->priv = priv = egg_wrap_box_get_instance_private (box);
 
   priv->orientation          = GTK_ORIENTATION_HORIZONTAL;
   priv->mode                 = EGG_WRAP_ALLOCATE_FREE;
diff --git a/widgets/gossip-cell-renderer-expander.c b/widgets/gossip-cell-renderer-expander.c
index d2dbf646a..51d091f86 100644
--- a/widgets/gossip-cell-renderer-expander.c
+++ b/widgets/gossip-cell-renderer-expander.c
@@ -22,7 +22,7 @@
 
 #include "gossip-cell-renderer-expander.h"
 
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOSSIP_TYPE_CELL_RENDERER_EXPANDER, 
GossipCellRendererExpanderPriv))
+#define GET_PRIV(obj) (gossip_cell_renderer_expander_get_instance_private (obj))
 
 static void     gossip_cell_renderer_expander_init         (GossipCellRendererExpander      *expander);
 static void     gossip_cell_renderer_expander_class_init   (GossipCellRendererExpanderClass *klass);
@@ -63,21 +63,22 @@ enum {
        PROP_ACTIVATABLE
 };
 
-typedef struct _GossipCellRendererExpanderPriv GossipCellRendererExpanderPriv;
+typedef struct _GossipCellRendererExpanderPrivate GossipCellRendererExpanderPrivate;
 
-struct _GossipCellRendererExpanderPriv {
+struct _GossipCellRendererExpanderPrivate {
        gint                 expander_size;
 
        guint                activatable : 1;
        GtkExpanderStyle     expander_style;
 };
 
-G_DEFINE_TYPE (GossipCellRendererExpander, gossip_cell_renderer_expander, GTK_TYPE_CELL_RENDERER)
+G_DEFINE_TYPE_WITH_CODE (GossipCellRendererExpander, gossip_cell_renderer_expander, GTK_TYPE_CELL_RENDERER,
+                        G_ADD_PRIVATE (GossipCellRendererExpander))
 
 static void
 gossip_cell_renderer_expander_init (GossipCellRendererExpander *expander)
 {
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
 
        priv = GET_PRIV (expander);
 
@@ -132,8 +133,6 @@ gossip_cell_renderer_expander_class_init (GossipCellRendererExpanderClass *klass
                                                               "The expander can be activated",
                                                               TRUE,
                                                               G_PARAM_READWRITE));
-
-       g_type_class_add_private (object_class, sizeof (GossipCellRendererExpanderPriv));
 }
 
 static void
@@ -143,7 +142,7 @@ gossip_cell_renderer_expander_get_property (GObject    *object,
                                            GParamSpec *pspec)
 {
        GossipCellRendererExpander     *expander;
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
 
        expander = GOSSIP_CELL_RENDERER_EXPANDER (object);
        priv = GET_PRIV (expander);
@@ -174,7 +173,7 @@ gossip_cell_renderer_expander_set_property (GObject      *object,
                                            GParamSpec   *pspec)
 {
        GossipCellRendererExpander     *expander;
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
 
        expander = GOSSIP_CELL_RENDERER_EXPANDER (object);
        priv = GET_PRIV (expander);
@@ -215,7 +214,7 @@ gossip_cell_renderer_expander_get_size (GtkCellRenderer *cell,
                                        gint            *height)
 {
        GossipCellRendererExpander     *expander;
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
        gint                            xpad, ypad;
        gfloat                          xalign, yalign;
 
@@ -260,7 +259,7 @@ gossip_cell_renderer_expander_render (GtkCellRenderer      *cell,
                                      GtkCellRendererState  flags)
 {
        GossipCellRendererExpander     *expander;
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
        GtkStyleContext                *style_context;
        gint                            x_offset, y_offset;
        gint                            xpad, ypad;
@@ -312,13 +311,13 @@ gossip_cell_renderer_expander_activate (GtkCellRenderer      *cell,
                                        const GdkRectangle   *cell_area,
                                        GtkCellRendererState  flags)
 {
-       GossipCellRendererExpanderPriv *priv;
+       GossipCellRendererExpanderPrivate *priv;
        GtkTreePath                    *path;
        gboolean                        in_cell;
        int                             mouse_x;
        int                             mouse_y;
 
-       priv = GET_PRIV (cell);
+       priv = GET_PRIV (GOSSIP_CELL_RENDERER_EXPANDER (cell));
 
        if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
                return FALSE;
diff --git a/widgets/rb-button-bar.c b/widgets/rb-button-bar.c
index 600f7abc7..ec2948c06 100644
--- a/widgets/rb-button-bar.c
+++ b/widgets/rb-button-bar.c
@@ -47,7 +47,7 @@ struct _RBButtonBarPrivate
        int position;
 };
 
-G_DEFINE_TYPE (RBButtonBar, rb_button_bar, GTK_TYPE_GRID);
+G_DEFINE_TYPE_WITH_CODE (RBButtonBar, rb_button_bar, GTK_TYPE_GRID, G_ADD_PRIVATE (RBButtonBar));
 
 enum {
        PROP_0,
@@ -306,7 +306,7 @@ impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp
 static void
 rb_button_bar_init (RBButtonBar *bar)
 {
-       bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (bar, RB_TYPE_BUTTON_BAR, RBButtonBarPrivate);
+       bar->priv = rb_button_bar_get_instance_private (bar);
 }
 
 static void
@@ -314,8 +314,6 @@ rb_button_bar_class_init (RBButtonBarClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBButtonBarPrivate));
-
        gobject_class->constructed = impl_constructed;
        gobject_class->dispose = impl_dispose;
        gobject_class->set_property = impl_set_property;
diff --git a/widgets/rb-cell-renderer-rating.c b/widgets/rb-cell-renderer-rating.c
index b9c126e18..049ee635b 100644
--- a/widgets/rb-cell-renderer-rating.c
+++ b/widgets/rb-cell-renderer-rating.c
@@ -73,10 +73,7 @@ struct RBCellRendererRatingClassPrivate
        RBRatingPixbufs *pixbufs;
 };
 
-G_DEFINE_TYPE (RBCellRendererRating, rb_cell_renderer_rating, GTK_TYPE_CELL_RENDERER)
-#define RB_CELL_RENDERER_RATING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
-                                               RB_TYPE_CELL_RENDERER_RATING, \
-                                               RBCellRendererRatingPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBCellRendererRating, rb_cell_renderer_rating, GTK_TYPE_CELL_RENDERER, 
G_ADD_PRIVATE (RBCellRendererRating))
 
 
 /**
@@ -111,7 +108,7 @@ rb_cell_renderer_rating_init (RBCellRendererRating *cellrating)
                klass->priv->pixbufs = rb_rating_pixbufs_load ();
        }
 
-       cellrating->priv = RB_CELL_RENDERER_RATING_GET_PRIVATE (cellrating);
+       cellrating->priv = rb_cell_renderer_rating_get_instance_private (cellrating);
 
        /* set the renderer able to be activated */
        g_object_set (cellrating,
@@ -162,8 +159,6 @@ rb_cell_renderer_rating_class_init (RBCellRendererRatingClass *class)
                              2,
                              G_TYPE_STRING,
                              G_TYPE_DOUBLE);
-
-       g_type_class_add_private (class, sizeof (RBCellRendererRatingPrivate));
 }
 
 static void
diff --git a/widgets/rb-encoding-settings.c b/widgets/rb-encoding-settings.c
index 772d68680..d12bd4af2 100644
--- a/widgets/rb-encoding-settings.c
+++ b/widgets/rb-encoding-settings.c
@@ -82,7 +82,7 @@ struct _RBEncodingSettingsPrivate
        gulong profile_changed_id;
 };
 
-G_DEFINE_TYPE (RBEncodingSettings, rb_encoding_settings, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_CODE (RBEncodingSettings, rb_encoding_settings, GTK_TYPE_BOX, G_ADD_PRIVATE 
(RBEncodingSettings));
 
 /**
  * SECTION:rb-encoding-settings
@@ -629,9 +629,7 @@ impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
 static void
 rb_encoding_settings_init (RBEncodingSettings *settings)
 {
-       settings->priv = G_TYPE_INSTANCE_GET_PRIVATE (settings,
-                                                     RB_TYPE_ENCODING_SETTINGS,
-                                                     RBEncodingSettingsPrivate);
+       settings->priv = rb_encoding_settings_get_instance_private (settings);
 }
 
 static void
@@ -714,8 +712,6 @@ rb_encoding_settings_class_init (RBEncodingSettingsClass *klass)
                                                               "whether to show options relating to lossless 
encodings",
                                                               FALSE,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBEncodingSettingsPrivate));
 }
 
 /**
diff --git a/widgets/rb-entry-view.c b/widgets/rb-entry-view.c
index 2839909cf..f468eab54 100644
--- a/widgets/rb-entry-view.c
+++ b/widgets/rb-entry-view.c
@@ -235,7 +235,7 @@ enum
        PROP_VISIBLE_COLUMNS
 };
 
-G_DEFINE_TYPE (RBEntryView, rb_entry_view, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_CODE (RBEntryView, rb_entry_view, GTK_TYPE_BOX, G_ADD_PRIVATE (RBEntryView))
 
 static guint rb_entry_view_signals[LAST_SIGNAL] = { 0 };
 
@@ -505,15 +505,13 @@ rb_entry_view_class_init (RBEntryViewClass *klass)
                              1,
                              G_TYPE_BOOLEAN);
 
-       g_type_class_add_private (klass, sizeof (RBEntryViewPrivate));
-
        rb_entry_view_column_always_visible = g_quark_from_static_string 
("rb_entry_view_column_always_visible");
 }
 
 static void
 rb_entry_view_init (RBEntryView *view)
 {
-       view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view, RB_TYPE_ENTRY_VIEW, RBEntryViewPrivate);
+       view->priv = rb_entry_view_get_instance_private (view);
 
        view->priv->propid_column_map = g_hash_table_new (NULL, NULL);
        view->priv->column_sort_data_map = g_hash_table_new_full (NULL, NULL, NULL, g_free);
diff --git a/widgets/rb-fading-image.c b/widgets/rb-fading-image.c
index 88190ed9c..2d1587022 100644
--- a/widgets/rb-fading-image.c
+++ b/widgets/rb-fading-image.c
@@ -67,7 +67,7 @@ struct _RBFadingImagePrivate
        gboolean use_tooltip;
 };
 
-G_DEFINE_TYPE (RBFadingImage, rb_fading_image, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_CODE (RBFadingImage, rb_fading_image, GTK_TYPE_WIDGET, G_ADD_PRIVATE (RBFadingImage))
 
 /**
  * SECTION:rb-fading-image
@@ -473,7 +473,7 @@ impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp
 static void
 rb_fading_image_init (RBFadingImage *image)
 {
-       image->priv = G_TYPE_INSTANCE_GET_PRIVATE (image, RB_TYPE_FADING_IMAGE, RBFadingImagePrivate);
+       image->priv = rb_fading_image_get_instance_private (image);
 }
 
 static void
@@ -552,8 +552,6 @@ rb_fading_image_class_init (RBFadingImageClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              1, GDK_TYPE_PIXBUF);
-
-       g_type_class_add_private (klass, sizeof (RBFadingImagePrivate));
 }
 
 
diff --git a/widgets/rb-header.c b/widgets/rb-header.c
index 262584941..cc82c25ac 100644
--- a/widgets/rb-header.c
+++ b/widgets/rb-header.c
@@ -168,7 +168,7 @@ static const char *const UNICODE_MIDDLE_DOT = "\xC2\xB7";
 #define SCROLL_UP_SEEK_OFFSET  5
 #define SCROLL_DOWN_SEEK_OFFSET -5
 
-G_DEFINE_TYPE (RBHeader, rb_header, GTK_TYPE_GRID)
+G_DEFINE_TYPE_WITH_CODE (RBHeader, rb_header, GTK_TYPE_GRID, G_ADD_PRIVATE (RBHeader))
 
 static void
 rb_header_class_init (RBHeaderClass *klass)
@@ -276,14 +276,12 @@ rb_header_class_init (RBHeaderClass *klass)
                                                               "whether to show album art",
                                                               TRUE,
                                                               G_PARAM_READWRITE));
-
-       g_type_class_add_private (klass, sizeof (RBHeaderPrivate));
 }
 
 static void
 rb_header_init (RBHeader *header)
 {
-       header->priv = G_TYPE_INSTANCE_GET_PRIVATE (header, RB_TYPE_HEADER, RBHeaderPrivate);
+       header->priv = rb_header_get_instance_private (header);
 }
 
 static void
diff --git a/widgets/rb-import-dialog.c b/widgets/rb-import-dialog.c
index 86c36823f..4fcc4ea45 100644
--- a/widgets/rb-import-dialog.c
+++ b/widgets/rb-import-dialog.c
@@ -708,9 +708,7 @@ impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
 static void
 rb_import_dialog_init (RBImportDialog *dialog)
 {
-       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog,
-                                                   RB_TYPE_IMPORT_DIALOG,
-                                                   RBImportDialogPrivate);
+       dialog->priv = rb_import_dialog_get_instance_private (dialog);
 }
 
 static void
@@ -750,8 +748,6 @@ rb_import_dialog_class_init (RBImportDialogClass *klass)
                                        G_TYPE_NONE,
                                        0);
 
-       g_type_class_add_private (object_class, sizeof (RBImportDialogPrivate));
-
        gtk_binding_entry_add_signal (gtk_binding_set_by_class (klass),
                                      GDK_KEY_Escape,
                                      0,
diff --git a/widgets/rb-library-browser.c b/widgets/rb-library-browser.c
index 1cc8c06c2..ff7b8b803 100644
--- a/widgets/rb-library-browser.c
+++ b/widgets/rb-library-browser.c
@@ -68,9 +68,6 @@ typedef struct _RBLibraryBrowserRebuildData RBLibraryBrowserRebuildData;
 
 static void destroy_idle_rebuild_model (RBLibraryBrowserRebuildData *data);
 
-G_DEFINE_TYPE (RBLibraryBrowser, rb_library_browser, GTK_TYPE_BOX)
-#define RB_LIBRARY_BROWSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_LIBRARY_BROWSER, 
RBLibraryBrowserPrivate))
-
 /**
  * SECTION:rb-library-browser
  * @short_description: album/artist/genre browser widget
@@ -115,6 +112,9 @@ typedef struct
        RBLibraryBrowserRebuildData *rebuild_data;
 } RBLibraryBrowserPrivate;
 
+G_DEFINE_TYPE_WITH_CODE (RBLibraryBrowser, rb_library_browser, GTK_TYPE_BOX, G_ADD_PRIVATE 
(RBLibraryBrowser))
+#define RB_LIBRARY_BROWSER_GET_PRIVATE(o) (rb_library_browser_get_instance_private (RB_LIBRARY_BROWSER (o)))
+
 enum
 {
        PROP_0,
@@ -218,8 +218,6 @@ rb_library_browser_class_init (RBLibraryBrowserClass *klass)
                                                              "browser view selection",
                                                              "artists-albums",
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
-       g_type_class_add_private (klass, sizeof (RBLibraryBrowserPrivate));
 }
 
 static void
diff --git a/widgets/rb-object-property-editor.c b/widgets/rb-object-property-editor.c
index b3dd564dc..01f88bc2f 100644
--- a/widgets/rb-object-property-editor.c
+++ b/widgets/rb-object-property-editor.c
@@ -44,7 +44,7 @@ struct _RBObjectPropertyEditorPrivate
        gulong notify_id;
 };
 
-G_DEFINE_TYPE (RBObjectPropertyEditor, rb_object_property_editor, GTK_TYPE_GRID);
+G_DEFINE_TYPE_WITH_CODE (RBObjectPropertyEditor, rb_object_property_editor, GTK_TYPE_GRID, G_ADD_PRIVATE 
(RBObjectPropertyEditor));
 
 /**
  * SECTION:rb-object-property-editor
@@ -347,9 +347,7 @@ impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
 static void
 rb_object_property_editor_init (RBObjectPropertyEditor *editor)
 {
-       editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor,
-                                                   RB_TYPE_OBJECT_PROPERTY_EDITOR,
-                                                   RBObjectPropertyEditorPrivate);
+       editor->priv = rb_object_property_editor_get_instance_private (editor);
 }
 
 
@@ -408,8 +406,6 @@ rb_object_property_editor_class_init (RBObjectPropertyEditorClass *klass)
                                                             "properties to edit",
                                                             G_TYPE_STRV,
                                                             G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBObjectPropertyEditorPrivate));
 }
 
 /**
diff --git a/widgets/rb-property-view.c b/widgets/rb-property-view.c
index 2195f1162..56acaed79 100644
--- a/widgets/rb-property-view.c
+++ b/widgets/rb-property-view.c
@@ -91,8 +91,6 @@ struct RBPropertyViewPrivate
        guint reset_selection_id;
 };
 
-#define RB_PROPERTY_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_PROPERTY_VIEW, 
RBPropertyViewPrivate))
-
 /**
  * SECTION:rb-property-view
  * @short_description: a #GtkTreeView backed by a #RhythmDBPropertyModel
@@ -129,7 +127,7 @@ enum
 
 static guint rb_property_view_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBPropertyView, rb_property_view, GTK_TYPE_SCROLLED_WINDOW)
+G_DEFINE_TYPE_WITH_CODE (RBPropertyView, rb_property_view, GTK_TYPE_SCROLLED_WINDOW, G_ADD_PRIVATE 
(RBPropertyView))
 
 static void
 rb_property_view_class_init (RBPropertyViewClass *klass)
@@ -299,14 +297,12 @@ rb_property_view_class_init (RBPropertyViewClass *klass)
                              NULL,
                              G_TYPE_NONE,
                              0);
-
-       g_type_class_add_private (klass, sizeof (RBPropertyViewPrivate));
 }
 
 static void
 rb_property_view_init (RBPropertyView *view)
 {
-       view->priv = RB_PROPERTY_VIEW_GET_PRIVATE (view);
+       view->priv = rb_property_view_get_instance_private (view);
 }
 
 static void
diff --git a/widgets/rb-query-creator.c b/widgets/rb-query-creator.c
index 5739abc20..8b2fdad7d 100644
--- a/widgets/rb-query-creator.c
+++ b/widgets/rb-query-creator.c
@@ -99,8 +99,8 @@ typedef struct
        GtkWidget *sort_desc;
 } RBQueryCreatorPrivate;
 
-G_DEFINE_TYPE (RBQueryCreator, rb_query_creator, GTK_TYPE_DIALOG)
-#define QUERY_CREATOR_GET_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), rb_query_creator_get_type(), 
RBQueryCreatorPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBQueryCreator, rb_query_creator, GTK_TYPE_DIALOG, G_ADD_PRIVATE (RBQueryCreator))
+#define QUERY_CREATOR_GET_PRIVATE(o)  (rb_query_creator_get_instance_private (RB_QUERY_CREATOR (o)))
 
 /**
  * SECTION:rb-query-creator
@@ -162,8 +162,6 @@ rb_query_creator_class_init (RBQueryCreatorClass *klass)
                                                               "Whether or not we're creating a new playlist",
                                                               TRUE,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBQueryCreatorPrivate));
 }
 
 static void
diff --git a/widgets/rb-rating.c b/widgets/rb-rating.c
index 1f7724a55..b3b969fe5 100644
--- a/widgets/rb-rating.c
+++ b/widgets/rb-rating.c
@@ -70,8 +70,7 @@ struct _RBRatingPrivate
        RBRatingPixbufs *pixbufs;
 };
 
-G_DEFINE_TYPE (RBRating, rb_rating, GTK_TYPE_WIDGET)
-#define RB_RATING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_RATING, RBRatingPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBRating, rb_rating, GTK_TYPE_WIDGET, G_ADD_PRIVATE (RBRating))
 
 /**
  * SECTION:rb-rating
@@ -195,14 +194,12 @@ rb_rating_class_init (RBRatingClass *klass)
        gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Subtract, 0, "adjust-rating", 1, G_TYPE_DOUBLE, 
-1.0);
        gtk_binding_entry_add_signal (binding_set, GDK_KEY_Left, 0, "adjust-rating", 1, G_TYPE_DOUBLE, -1.0);
        gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Left, 0, "adjust-rating", 1, G_TYPE_DOUBLE, 
-1.0);
-       
-       g_type_class_add_private (klass, sizeof (RBRatingPrivate));
 }
 
 static void
 rb_rating_init (RBRating *rating)
 {
-       rating->priv = RB_RATING_GET_PRIVATE (rating);
+       rating->priv = rb_rating_get_instance_private (rating);
 
        /* create the needed icons */
        rating->priv->pixbufs = rb_rating_pixbufs_load ();
diff --git a/widgets/rb-search-entry.c b/widgets/rb-search-entry.c
index 2b839f4ca..349dea29c 100644
--- a/widgets/rb-search-entry.c
+++ b/widgets/rb-search-entry.c
@@ -72,8 +72,7 @@ struct RBSearchEntryPrivate
        guint timeout;
 };
 
-G_DEFINE_TYPE (RBSearchEntry, rb_search_entry, GTK_TYPE_BOX)
-#define RB_SEARCH_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SEARCH_ENTRY, 
RBSearchEntryPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBSearchEntry, rb_search_entry, GTK_TYPE_BOX, G_ADD_PRIVATE (RBSearchEntry))
 
 /**
  * SECTION:rb-search-entry
@@ -196,14 +195,12 @@ rb_search_entry_class_init (RBSearchEntryClass *klass)
                                                               "whether to display the search menu icon",
                                                               FALSE,
                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-       g_type_class_add_private (klass, sizeof (RBSearchEntryPrivate));
 }
 
 static void
 rb_search_entry_init (RBSearchEntry *entry)
 {
-       entry->priv = RB_SEARCH_ENTRY_GET_PRIVATE (entry);
+       entry->priv = rb_search_entry_get_instance_private (entry);
        gtk_orientable_set_orientation (GTK_ORIENTABLE (entry), GTK_ORIENTATION_HORIZONTAL);
 }
 
diff --git a/widgets/rb-segmented-bar.c b/widgets/rb-segmented-bar.c
index 282d1376e..efe4fe903 100644
--- a/widgets/rb-segmented-bar.c
+++ b/widgets/rb-segmented-bar.c
@@ -89,8 +89,8 @@ struct _RBSegmentedBarPrivate {
        char *a11y_locale;
 };
 
-G_DEFINE_TYPE (RBSegmentedBar, rb_segmented_bar, GTK_TYPE_WIDGET)
-#define RB_SEGMENTED_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SEGMENTED_BAR, 
RBSegmentedBarPrivate))
+G_DEFINE_TYPE_WITH_CODE (RBSegmentedBar, rb_segmented_bar, GTK_TYPE_WIDGET, G_ADD_PRIVATE (RBSegmentedBar))
+#define RB_SEGMENTED_BAR_GET_PRIVATE(o) (rb_segmented_bar_get_instance_private (RB_SEGMENTED_BAR (o)))
 
 struct _Color {
        gdouble red;
@@ -201,8 +201,6 @@ rb_segmented_bar_class_init (RBSegmentedBarClass *klass)
                                                            "height of the segmented bar",
                                                            MINIMUM_HEIGHT, G_MAXUINT, MINIMUM_HEIGHT,
                                                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
-       g_type_class_add_private (klass, sizeof (RBSegmentedBarPrivate));
 }
 
 static void
diff --git a/widgets/rb-song-info.c b/widgets/rb-song-info.c
index 202f3d36e..cd6a9cd04 100644
--- a/widgets/rb-song-info.c
+++ b/widgets/rb-song-info.c
@@ -158,8 +158,6 @@ struct RBSongInfoPrivate
        RhythmDBPropertyModel* genres;
 };
 
-#define RB_SONG_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SONG_INFO, RBSongInfoPrivate))
-
 /**
  * SECTION:rb-song-info
  * @short_description: song properties dialog
@@ -207,7 +205,7 @@ enum
 
 static guint rb_song_info_signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBSongInfo, rb_song_info, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (RBSongInfo, rb_song_info, GTK_TYPE_DIALOG, G_ADD_PRIVATE (RBSongInfo))
 
 static void
 rb_song_info_class_init (RBSongInfoClass *klass)
@@ -318,15 +316,13 @@ rb_song_info_class_init (RBSongInfoClass *klass)
                              G_TYPE_NONE,
                              1,
                              RHYTHMDB_TYPE_ENTRY);
-
-       g_type_class_add_private (klass, sizeof (RBSongInfoPrivate));
 }
 
 static void
 rb_song_info_init (RBSongInfo *song_info)
 {
        /* create the dialog and some buttons backward - forward - close */
-       song_info->priv = RB_SONG_INFO_GET_PRIVATE (song_info);
+       song_info->priv = rb_song_info_get_instance_private (song_info);
 
        g_signal_connect_object (G_OBJECT (song_info),
                                 "response",
diff --git a/widgets/rb-source-toolbar.c b/widgets/rb-source-toolbar.c
index 43df4c834..8ba78bc74 100644
--- a/widgets/rb-source-toolbar.c
+++ b/widgets/rb-source-toolbar.c
@@ -53,7 +53,7 @@ struct _RBSourceToolbarPrivate
        GAction *search_action;
 };
 
-G_DEFINE_TYPE (RBSourceToolbar, rb_source_toolbar, GTK_TYPE_GRID)
+G_DEFINE_TYPE_WITH_CODE (RBSourceToolbar, rb_source_toolbar, GTK_TYPE_GRID, G_ADD_PRIVATE (RBSourceToolbar))
 
 /**
  * SECTION:rb-source-toolbar
@@ -226,7 +226,7 @@ impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp
 static void
 rb_source_toolbar_init (RBSourceToolbar *toolbar)
 {
-       toolbar->priv = G_TYPE_INSTANCE_GET_PRIVATE (toolbar, RB_TYPE_SOURCE_TOOLBAR, RBSourceToolbarPrivate);
+       toolbar->priv = rb_source_toolbar_get_instance_private (toolbar);
 
        toolbar->priv->search_value = -1;
 }
@@ -266,7 +266,6 @@ rb_source_toolbar_class_init (RBSourceToolbarClass *klass)
                                                              "GtkAccelGroup instance",
                                                              GTK_TYPE_ACCEL_GROUP,
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-       g_type_class_add_private (klass, sizeof (RBSourceToolbarPrivate));
 }
 
 /**
diff --git a/widgets/rb-task-list-display.c b/widgets/rb-task-list-display.c
index 90e608f8a..9c58a52d1 100644
--- a/widgets/rb-task-list-display.c
+++ b/widgets/rb-task-list-display.c
@@ -45,7 +45,7 @@ struct _RBTaskListDisplayPrivate
        GArray *widgets;
 };
 
-G_DEFINE_TYPE (RBTaskListDisplay, rb_task_list_display, GTK_TYPE_GRID);
+G_DEFINE_TYPE_WITH_CODE (RBTaskListDisplay, rb_task_list_display, GTK_TYPE_GRID, G_ADD_PRIVATE 
(RBTaskListDisplay));
 
 enum {
        PROP_0,
@@ -199,7 +199,7 @@ impl_dispose (GObject *object)
 static void
 rb_task_list_display_init (RBTaskListDisplay *list)
 {
-       list->priv = G_TYPE_INSTANCE_GET_PRIVATE (list, RB_TYPE_TASK_LIST_DISPLAY, RBTaskListDisplayPrivate);
+       list->priv = rb_task_list_display_get_instance_private (list);
 
        list->priv->widgets = g_array_new (FALSE, FALSE, sizeof (GtkWidget *));
 }
@@ -209,8 +209,6 @@ rb_task_list_display_class_init (RBTaskListDisplayClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (RBTaskListDisplayPrivate));
-
        gobject_class->constructed = impl_constructed;
        gobject_class->dispose = impl_dispose;
        gobject_class->set_property = impl_set_property;
diff --git a/widgets/rb-uri-dialog.c b/widgets/rb-uri-dialog.c
index a9d16042c..1e473328c 100644
--- a/widgets/rb-uri-dialog.c
+++ b/widgets/rb-uri-dialog.c
@@ -75,8 +75,6 @@ struct RBURIDialogPrivate
        GtkWidget   *cancelbutton;
 };
 
-#define RB_URI_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_URI_DIALOG, 
RBURIDialogPrivate))
-
 enum
 {
        LOCATION_ADDED,
@@ -91,7 +89,7 @@ enum
 
 static guint rb_uri_dialog_signals [LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (RBURIDialog, rb_uri_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_CODE (RBURIDialog, rb_uri_dialog, GTK_TYPE_DIALOG, G_ADD_PRIVATE (RBURIDialog))
 
 static void
 rb_uri_dialog_class_init (RBURIDialogClass *klass)
@@ -131,8 +129,6 @@ rb_uri_dialog_class_init (RBURIDialogClass *klass)
                              G_TYPE_NONE,
                              1,
                              G_TYPE_STRING);
-
-       g_type_class_add_private (klass, sizeof (RBURIDialogPrivate));
 }
 
 static void
@@ -142,7 +138,7 @@ rb_uri_dialog_init (RBURIDialog *dialog)
        GtkBuilder *builder;
 
        /* create the dialog and some buttons forward - close */
-       dialog->priv = RB_URI_DIALOG_GET_PRIVATE (dialog);
+       dialog->priv = rb_uri_dialog_get_instance_private (dialog);
 
        g_signal_connect_object (G_OBJECT (dialog),
                                 "response",



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