[rhythmbox] use GObject's 'constructed' method rather 'constructor'
- From: Jonathan Matthew <jmatthew src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rhythmbox] use GObject's 'constructed' method rather 'constructor'
- Date: Sun, 18 Oct 2009 12:05:28 +0000 (UTC)
commit d84de5ed71955fc5501d1b2e63b07e41fa1a716e
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Oct 18 21:54:22 2009 +1000
use GObject's 'constructed' method rather 'constructor'
This mostly just makes the code a bit less scary looking.
lib/libmediaplayerid/mpid-device.c | 15 +++++-----
lib/rb-util.h | 4 +++
plugins/audiocd/rb-audiocd-source.c | 17 ++++-------
plugins/audioscrobbler/rb-audioscrobbler.c | 30 +++++----------------
plugins/audioscrobbler/rb-lastfm-source.c | 25 ++++++-----------
plugins/cd-recorder/rb-playlist-source-recorder.c | 16 ++++-------
plugins/fmradio/rb-fm-radio-source.c | 18 ++++--------
plugins/generic-player/rb-generic-player-source.c | 18 ++++--------
plugins/ipod/rb-ipod-source.c | 22 ++++++---------
plugins/ipod/rb-ipod-static-playlist-source.c | 22 ++++-----------
plugins/iradio/rb-iradio-source.c | 21 +++++---------
plugins/iradio/rb-station-properties-dialog.c | 20 +++++--------
plugins/mtpdevice/rb-mtp-source.c | 18 ++++--------
plugins/status-icon/rb-tray-icon-gtk.c | 20 ++++---------
plugins/status-icon/rb-tray-icon.c | 20 ++++---------
podcast/rb-podcast-manager.c | 20 ++++---------
rhythmdb/rhythmdb-query-model.c | 17 ++++-------
shell/rb-play-order.c | 16 -----------
shell/rb-shell-clipboard.c | 30 +++------------------
shell/rb-shell-player.c | 19 ++++---------
shell/rb-shell.c | 19 +++++--------
shell/rb-source-header.c | 26 +++---------------
shell/rb-statusbar.c | 24 ----------------
sources/rb-auto-playlist-source.c | 18 +++++-------
sources/rb-browser-source.c | 19 +++++--------
sources/rb-import-errors-source.c | 18 ++++--------
sources/rb-library-source.c | 18 ++++--------
sources/rb-missing-files-source.c | 19 ++++---------
sources/rb-play-queue-source.c | 27 +++++++++---------
sources/rb-playlist-source.c | 21 ++++----------
sources/rb-podcast-source.c | 21 ++++----------
sources/rb-removable-media-source.c | 23 +++++----------
sources/rb-sourcelist.c | 18 ++++--------
sources/rb-static-playlist-source.c | 27 +++++++++---------
sources/rb-streaming-source.c | 20 ++++---------
widgets/rb-entry-view.c | 20 +++++---------
widgets/rb-library-browser.c | 19 ++++---------
widgets/rb-property-view.c | 20 ++++---------
widgets/rb-query-creator.c | 18 +++++-------
widgets/rb-song-info.c | 21 +++++---------
40 files changed, 258 insertions(+), 546 deletions(-)
---
diff --git a/lib/libmediaplayerid/mpid-device.c b/lib/libmediaplayerid/mpid-device.c
index 31bc8f3..5868bcd 100644
--- a/lib/libmediaplayerid/mpid-device.c
+++ b/lib/libmediaplayerid/mpid-device.c
@@ -273,13 +273,16 @@ mpid_device_init (MPIDDevice *device)
device->folder_depth = -1;
}
-static GObject *
-mpid_device_constructor (GType type, guint n_properties, GObjectConstructParam *properties)
+static void
+mpid_device_constructed (GObject *object)
{
- GObjectClass *parent_class = G_OBJECT_CLASS (mpid_device_parent_class);
MPIDDevice *device;
- device = MPID_DEVICE (parent_class->constructor (type, n_properties, properties));
+ if (G_OBJECT_CLASS (mpid_device_parent_class)->constructed) {
+ G_OBJECT_CLASS (mpid_device_parent_class)->constructed (object);
+ }
+
+ device = MPID_DEVICE (object);
mpid_device_db_lookup (device);
if (device->source == MPID_SOURCE_SYSTEM) {
@@ -290,8 +293,6 @@ mpid_device_constructor (GType type, guint n_properties, GObjectConstructParam *
if (device->source == MPID_SOURCE_OVERRIDE) {
mpid_device_debug (device, "override file");
}
-
- return G_OBJECT (device);
}
static void
@@ -299,7 +300,7 @@ mpid_device_class_init (MPIDDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = mpid_device_constructor;
+ object_class->constructed = mpid_device_constructed;
object_class->finalize = mpid_device_finalize;
object_class->get_property = mpid_device_get_property;
object_class->set_property = mpid_device_set_property;
diff --git a/lib/rb-util.h b/lib/rb-util.h
index 4f93112..0a17102 100644
--- a/lib/rb-util.h
+++ b/lib/rb-util.h
@@ -40,6 +40,10 @@ G_BEGIN_DECLS
#define FFWD_OFFSET 20
#define RWD_OFFSET 10
+#define RB_CHAIN_GOBJECT_METHOD(klass, method, instance) \
+ if (G_OBJECT_CLASS (klass)->method != NULL) \
+ G_OBJECT_CLASS (klass)->method (instance);
+
gboolean rb_true_function (gpointer dummy);
gboolean rb_false_function (gpointer dummy);
gpointer rb_null_function (gpointer dummy);
diff --git a/plugins/audiocd/rb-audiocd-source.c b/plugins/audiocd/rb-audiocd-source.c
index 53a3641..5b3083d 100644
--- a/plugins/audiocd/rb-audiocd-source.c
+++ b/plugins/audiocd/rb-audiocd-source.c
@@ -64,8 +64,7 @@ enum
static void rb_audiocd_source_dispose (GObject *object);
static void rb_audiocd_source_finalize (GObject *object);
-static GObject *rb_audiocd_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_audiocd_source_constructed (GObject *object);
static void impl_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void impl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
@@ -162,7 +161,7 @@ rb_audiocd_source_class_init (RBAudioCdSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
- object_class->constructor = rb_audiocd_source_constructor;
+ object_class->constructed = rb_audiocd_source_constructed;
object_class->dispose = rb_audiocd_source_dispose;
object_class->finalize = rb_audiocd_source_finalize;
object_class->set_property = impl_set_property;
@@ -241,10 +240,8 @@ rb_audiocd_source_dispose (GObject *object)
G_OBJECT_CLASS (rb_audiocd_source_parent_class)->dispose (object);
}
-static GObject *
-rb_audiocd_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_audiocd_source_constructed (GObject *object)
{
RBAudioCdSourcePrivate *priv;
RBAudioCdSource *source;
@@ -253,8 +250,8 @@ rb_audiocd_source_constructor (GType type,
RBPlugin *plugin;
char *ui_file;
- source = RB_AUDIOCD_SOURCE (G_OBJECT_CLASS (rb_audiocd_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_audiocd_source_parent_class, constructed, object);
+ source = RB_AUDIOCD_SOURCE (object);
priv = AUDIOCD_SOURCE_GET_PRIVATE (source);
g_object_set (G_OBJECT (source), "name", "Unknown Audio", NULL);
@@ -351,8 +348,6 @@ rb_audiocd_source_constructor (GType type,
g_object_ref (G_OBJECT (source));
g_thread_create ((GThreadFunc)rb_audiocd_load_songs, source, FALSE, NULL);
-
- return G_OBJECT (source);
}
RBRemovableMediaSource *
diff --git a/plugins/audioscrobbler/rb-audioscrobbler.c b/plugins/audioscrobbler/rb-audioscrobbler.c
index fadc7b7..f4be651 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler.c
@@ -214,37 +214,22 @@ enum
G_DEFINE_TYPE (RBAudioscrobbler, rb_audioscrobbler, G_TYPE_OBJECT)
-static GObject *
-rb_audioscrobbler_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_audioscrobbler_constructed (GObject *object)
{
- GObject *obj;
RBAudioscrobbler *audioscrobbler;
RhythmDB *db;
- /* Invoke parent constructor. */
- RBAudioscrobblerClass *klass;
- GObjectClass *parent_class;
- klass = RB_AUDIOSCROBBLER_CLASS (g_type_class_peek (RB_TYPE_AUDIOSCROBBLER));
- parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
- obj = parent_class->constructor (type,
- n_construct_properties,
- construct_properties);
-
- audioscrobbler = RB_AUDIOSCROBBLER (obj);
- g_object_get (G_OBJECT (audioscrobbler->priv->shell_player),
- "db", &db,
- NULL);
+ RB_CHAIN_GOBJECT_METHOD (rb_audioscrobbler_parent_class, constructed, object);
+ audioscrobbler = RB_AUDIOSCROBBLER (object);
+ g_object_get (audioscrobbler->priv->shell_player, "db", &db, NULL);
audioscrobbler->priv->offline_play_notify_id =
g_signal_connect_object (db,
"entry-extra-metadata-notify::rb:offlinePlay",
(GCallback)rb_audioscrobbler_offline_play_notify_cb,
audioscrobbler, 0);
- g_object_unref (G_OBJECT (db));
-
- return obj;
+ g_object_unref (db);
}
/* Class-related functions: */
@@ -253,8 +238,7 @@ rb_audioscrobbler_class_init (RBAudioscrobblerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->constructor = rb_audioscrobbler_constructor;
+ object_class->constructed = rb_audioscrobbler_constructed;
object_class->dispose = rb_audioscrobbler_dispose;
object_class->finalize = rb_audioscrobbler_finalize;
diff --git a/plugins/audioscrobbler/rb-lastfm-source.c b/plugins/audioscrobbler/rb-lastfm-source.c
index c71d3af..c6fc1d6 100644
--- a/plugins/audioscrobbler/rb-lastfm-source.c
+++ b/plugins/audioscrobbler/rb-lastfm-source.c
@@ -123,8 +123,7 @@ static void queue_ban_track (RBLastfmSource *source);
static void rb_lastfm_source_class_init (RBLastfmSourceClass *klass);
static void rb_lastfm_source_init (RBLastfmSource *source);
-static GObject *rb_lastfm_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_lastfm_source_constructed (GObject *object);
static void rb_lastfm_source_finalize (GObject *object);
static void rb_lastfm_source_set_property (GObject *object,
guint prop_id,
@@ -308,7 +307,7 @@ rb_lastfm_source_class_init (RBLastfmSourceClass *klass)
object_class->finalize = rb_lastfm_source_finalize;
object_class->dispose = rb_lastfm_source_dispose;
- object_class->constructor = rb_lastfm_source_constructor;
+ object_class->constructed = rb_lastfm_source_constructed;
object_class->set_property = rb_lastfm_source_set_property;
object_class->get_property = rb_lastfm_source_get_property;
@@ -449,12 +448,10 @@ rb_lastfm_source_finalize (GObject *object)
G_OBJECT_CLASS (rb_lastfm_source_parent_class)->finalize (object);
}
-static GObject *
-rb_lastfm_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_lastfm_source_constructed (GObject *object)
{
RBLastfmSource *source;
- RBLastfmSourceClass *klass;
RBShell *shell;
GtkWidget *editor_vbox;
GtkWidget *editor_box;
@@ -464,17 +461,15 @@ rb_lastfm_source_constructor (GType type, guint n_construct_properties,
RhythmDBQueryModel *station_query_model;
int i;
- klass = RB_LASTFM_SOURCE_CLASS (g_type_class_peek (RB_TYPE_LASTFM_SOURCE));
-
- source = RB_LASTFM_SOURCE (G_OBJECT_CLASS (rb_lastfm_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_lastfm_source_parent_class, constructed, object);
+ source = RB_LASTFM_SOURCE (object);
- g_object_get (G_OBJECT (source), "shell", &shell, NULL);
- g_object_get (G_OBJECT (shell),
+ g_object_get (source, "shell", &shell, NULL);
+ g_object_get (shell,
"db", &source->priv->db,
"shell-player", &source->priv->shell_player,
NULL);
- g_object_unref (G_OBJECT (shell));
+ g_object_unref (shell);
g_signal_connect_object (source->priv->db,
"entry-added",
@@ -611,8 +606,6 @@ rb_lastfm_source_constructor (GType type, guint n_construct_properties,
rb_entry_view_set_model (source->priv->tracks, source->priv->query_model);
g_object_set (source, "query-model", source->priv->query_model, NULL);
-
- return G_OBJECT (source);
}
static void
diff --git a/plugins/cd-recorder/rb-playlist-source-recorder.c b/plugins/cd-recorder/rb-playlist-source-recorder.c
index 15e5196..cc5a6bd 100644
--- a/plugins/cd-recorder/rb-playlist-source-recorder.c
+++ b/plugins/cd-recorder/rb-playlist-source-recorder.c
@@ -72,8 +72,7 @@ extern char *mkdtemp (char *template);
static void rb_playlist_source_recorder_class_init (RBPlaylistSourceRecorderClass *klass);
static void rb_playlist_source_recorder_init (RBPlaylistSourceRecorder *source);
-static GObject *rb_playlist_source_recorder_constructor(GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_playlist_source_recorder_constructed (GObject *object);
static void rb_playlist_source_recorder_dispose (GObject *object);
static void rb_playlist_source_recorder_finalize (GObject *object);
@@ -180,7 +179,7 @@ rb_playlist_source_recorder_class_init (RBPlaylistSourceRecorderClass *klass)
widget_class->style_set = rb_playlist_source_recorder_style_set;
- object_class->constructor = rb_playlist_source_recorder_constructor;
+ object_class->constructed = rb_playlist_source_recorder_constructed;
object_class->dispose = rb_playlist_source_recorder_dispose;
object_class->finalize = rb_playlist_source_recorder_finalize;
object_class->set_property = rb_playlist_source_recorder_set_property;
@@ -1093,10 +1092,8 @@ rb_playlist_source_recorder_get_property (GObject *object,
}
}
-static GObject *
-rb_playlist_source_recorder_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_playlist_source_recorder_constructed (GObject *object)
{
RBPlaylistSourceRecorder *source;
char *builder_file;
@@ -1109,8 +1106,8 @@ rb_playlist_source_recorder_constructor (GType type,
PangoAttribute *attr;
char *value;
- source = RB_PLAYLIST_SOURCE_RECORDER (G_OBJECT_CLASS (rb_playlist_source_recorder_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_playlist_source_recorder_parent_class, constructed, object);
+ source = RB_PLAYLIST_SOURCE_RECORDER (object);
g_signal_connect (GTK_DIALOG (source),
"delete_event",
@@ -1258,7 +1255,6 @@ rb_playlist_source_recorder_constructor (GType type,
g_signal_connect (GTK_DIALOG (source), "response",
G_CALLBACK (response_cb), NULL);
- return G_OBJECT (source);
}
static RBRecorderSong *
diff --git a/plugins/fmradio/rb-fm-radio-source.c b/plugins/fmradio/rb-fm-radio-source.c
index 70e3f32..deea780 100644
--- a/plugins/fmradio/rb-fm-radio-source.c
+++ b/plugins/fmradio/rb-fm-radio-source.c
@@ -45,9 +45,7 @@
static void rb_fm_radio_source_class_init (RBFMRadioSourceClass *class);
static void rb_fm_radio_source_init (RBFMRadioSource *self);
-static GObject *rb_fm_radio_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_fm_radio_source_constructed (GObject *object);
static void rb_fm_radio_source_dispose (GObject *object);
static char *rb_fm_radio_source_get_playback_uri (RhythmDBEntry *entry, gpointer data);
static void rb_fm_radio_source_do_query (RBFMRadioSource *self);
@@ -98,7 +96,7 @@ rb_fm_radio_source_class_init (RBFMRadioSourceClass *class)
GObjectClass *object_class = G_OBJECT_CLASS (class);
RBSourceClass *source_class = RB_SOURCE_CLASS (class);
- object_class->constructor = rb_fm_radio_source_constructor;
+ object_class->constructed = rb_fm_radio_source_constructed;
object_class->dispose = rb_fm_radio_source_dispose;
g_type_class_add_private (class, sizeof (RBFMRadioSourcePrivate));
@@ -119,16 +117,14 @@ rb_fm_radio_source_init (RBFMRadioSource *self)
self, RB_TYPE_FM_RADIO_SOURCE, RBFMRadioSourcePrivate);
}
-static GObject *
-rb_fm_radio_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_fm_radio_source_constructed (GObject *object)
{
RBFMRadioSource *self;
RBShell *shell;
- self = RB_FM_RADIO_SOURCE (
- G_OBJECT_CLASS (rb_fm_radio_source_parent_class)->constructor
- (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_fm_radio_source_parent_class, constructed, object);
+ self = RB_FM_RADIO_SOURCE (object);
g_object_get (self,
"shell", &shell,
@@ -178,8 +174,6 @@ rb_fm_radio_source_constructor (GType type, guint n_construct_properties,
"playing-song-changed",
G_CALLBACK (playing_entry_changed),
self, 0);
-
- return G_OBJECT (self);
}
RBSource *
diff --git a/plugins/generic-player/rb-generic-player-source.c b/plugins/generic-player/rb-generic-player-source.c
index 91dbe0a..899fb9b 100644
--- a/plugins/generic-player/rb-generic-player-source.c
+++ b/plugins/generic-player/rb-generic-player-source.c
@@ -54,9 +54,7 @@
#include "rhythmdb-import-job.h"
#include "rb-import-errors-source.h"
-static GObject *impl_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void impl_constructed (GObject *object);
static void impl_dispose (GObject *object);
static void impl_finalize (GObject *object);
static void impl_set_property (GObject *object,
@@ -134,7 +132,7 @@ rb_generic_player_source_class_init (RBGenericPlayerSourceClass *klass)
object_class->set_property = impl_set_property;
object_class->get_property = impl_get_property;
- object_class->constructor = impl_constructor;
+ object_class->constructed = impl_constructed;
object_class->dispose = impl_dispose;
object_class->finalize = impl_finalize;
@@ -189,10 +187,8 @@ rb_generic_player_source_init (RBGenericPlayerSource *source)
}
-static GObject *
-impl_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+impl_constructed (GObject *object)
{
RBGenericPlayerSource *source;
RBGenericPlayerSourcePrivate *priv;
@@ -204,8 +200,8 @@ impl_constructor (GType type,
GFileInfo *info;
GError *error = NULL;
- source = RB_GENERIC_PLAYER_SOURCE (G_OBJECT_CLASS (rb_generic_player_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_generic_player_source_parent_class, constructed, object);
+ source = RB_GENERIC_PLAYER_SOURCE (object);
priv = GENERIC_PLAYER_SOURCE_GET_PRIVATE (source);
@@ -247,8 +243,6 @@ impl_constructor (GType type,
g_strfreev (playlist_formats);
load_songs (source);
-
- return G_OBJECT (source);
}
static void
diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c
index b6abd41..c0db8bb 100644
--- a/plugins/ipod/rb-ipod-source.c
+++ b/plugins/ipod/rb-ipod-source.c
@@ -54,9 +54,7 @@
#define CONF_STATE_PANED_POSITION CONF_PREFIX "/state/ipod/paned_position"
#define CONF_STATE_SHOW_BROWSER CONF_PREFIX "/state/ipod/show_browser"
-static GObject *rb_ipod_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_ipod_source_constructed (GObject *object);
static void rb_ipod_source_dispose (GObject *object);
static char *impl_get_browser_key (RBSource *source);
@@ -133,7 +131,7 @@ rb_ipod_source_class_init (RBiPodSourceClass *klass)
RBRemovableMediaSourceClass *rms_class = RB_REMOVABLE_MEDIA_SOURCE_CLASS (klass);
RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
- object_class->constructor = rb_ipod_source_constructor;
+ object_class->constructed = rb_ipod_source_constructed;
object_class->dispose = rb_ipod_source_dispose;
source_class->impl_can_browse = (RBSourceFeatureFunc) rb_true_function;
@@ -186,15 +184,15 @@ rb_ipod_source_init (RBiPodSource *source)
{
}
-static GObject *
-rb_ipod_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_ipod_source_constructed (GObject *object)
{
RBiPodSource *source;
RBEntryView *songs;
+ RhythmDB *db;
- source = RB_IPOD_SOURCE (G_OBJECT_CLASS (rb_ipod_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_ipod_source_parent_class, constructed, object);
+ source = RB_IPOD_SOURCE (object);
songs = rb_source_get_entry_view (RB_SOURCE (source));
rb_entry_view_append_column (songs, RB_ENTRY_VIEW_COL_RATING, FALSE);
@@ -203,14 +201,12 @@ rb_ipod_source_constructor (GType type, guint n_construct_properties,
rb_ipod_load_songs (source);
- RhythmDB *db = get_db_for_source (RB_IPOD_SOURCE (source));
+ db = get_db_for_source (source);
g_signal_connect_object (db,
"entry-extra-metadata-notify::rb:coverArt",
G_CALLBACK (rb_ipod_song_artwork_add_cb),
RB_IPOD_SOURCE(source), 0);
- g_object_unref (G_OBJECT (db));
-
- return G_OBJECT (source);
+ g_object_unref (db);
}
static void
diff --git a/plugins/ipod/rb-ipod-static-playlist-source.c b/plugins/ipod/rb-ipod-static-playlist-source.c
index 6c0d5ec..c5cb7c1 100644
--- a/plugins/ipod/rb-ipod-static-playlist-source.c
+++ b/plugins/ipod/rb-ipod-static-playlist-source.c
@@ -33,9 +33,7 @@
#include "rb-ipod-static-playlist-source.h"
#include "rb-ipod-source.h"
-static GObject *rb_ipod_static_playlist_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_ipod_static_playlist_source_constructed (GObject *object);
static void rb_ipod_static_playlist_source_dispose (GObject *object);
static void rb_ipod_static_playlist_source_set_property (GObject *object,
guint prop_id,
@@ -81,7 +79,7 @@ rb_ipod_static_playlist_source_class_init (RBIpodStaticPlaylistSourceClass *klas
GObjectClass *object_class = G_OBJECT_CLASS (klass);
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
- object_class->constructor = rb_ipod_static_playlist_source_constructor;
+ object_class->constructed = rb_ipod_static_playlist_source_constructed;
object_class->dispose = rb_ipod_static_playlist_source_dispose;
object_class->get_property = rb_ipod_static_playlist_source_get_property;
object_class->set_property = rb_ipod_static_playlist_source_set_property;
@@ -123,19 +121,11 @@ rb_ipod_static_playlist_source_init (RBIpodStaticPlaylistSource *source)
}
-static GObject *
-rb_ipod_static_playlist_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_ipod_static_playlist_source_constructed (GObject *object)
{
- RBIpodStaticPlaylistSource *source;
-
- source = RB_IPOD_STATIC_PLAYLIST_SOURCE (G_OBJECT_CLASS (rb_ipod_static_playlist_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
-
- g_signal_connect (G_OBJECT (source), "notify::name",
- (GCallback)source_name_changed_cb, NULL);
-
- return G_OBJECT (source);
+ RB_CHAIN_GOBJECT_METHOD (rb_ipod_static_playlist_source_parent_class, constructed, object);
+ g_signal_connect (object, "notify::name", (GCallback)source_name_changed_cb, NULL);
}
static void
diff --git a/plugins/iradio/rb-iradio-source.c b/plugins/iradio/rb-iradio-source.c
index 51b3407..e2f4790 100644
--- a/plugins/iradio/rb-iradio-source.c
+++ b/plugins/iradio/rb-iradio-source.c
@@ -65,8 +65,7 @@
static void rb_iradio_source_class_init (RBIRadioSourceClass *klass);
static void rb_iradio_source_init (RBIRadioSource *source);
-static GObject *rb_iradio_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_iradio_source_constructed (GObject *object);
static void rb_iradio_source_dispose (GObject *object);
static void rb_iradio_source_set_property (GObject *object,
guint prop_id,
@@ -189,7 +188,7 @@ rb_iradio_source_class_init (RBIRadioSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
object_class->dispose = rb_iradio_source_dispose;
- object_class->constructor = rb_iradio_source_constructor;
+ object_class->constructed = rb_iradio_source_constructed;
object_class->set_property = rb_iradio_source_set_property;
object_class->get_property = rb_iradio_source_get_property;
@@ -280,22 +279,20 @@ rb_iradio_source_dispose (GObject *object)
G_OBJECT_CLASS (rb_iradio_source_parent_class)->dispose (object);
}
-static GObject *
-rb_iradio_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_iradio_source_constructed (GObject *object)
{
RBIRadioSource *source;
RBShell *shell;
GtkAction *action;
- source = RB_IRADIO_SOURCE (G_OBJECT_CLASS (rb_iradio_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_iradio_source_parent_class, constructed, object);
+ source = RB_IRADIO_SOURCE (object);
source->priv->paned = gtk_hpaned_new ();
- g_object_get (G_OBJECT (source), "shell", &shell, NULL);
- g_object_get (G_OBJECT (shell),
+ g_object_get (source, "shell", &shell, NULL);
+ g_object_get (shell,
"db", &source->priv->db,
"shell-player", &source->priv->player,
NULL);
@@ -395,8 +392,6 @@ rb_iradio_source_constructor (GType type,
source->priv->default_search = rb_iradio_source_search_new ();
rb_iradio_source_do_query (source);
-
- return G_OBJECT (source);
}
static void
diff --git a/plugins/iradio/rb-station-properties-dialog.c b/plugins/iradio/rb-station-properties-dialog.c
index ed99d49..f52ba5d 100644
--- a/plugins/iradio/rb-station-properties-dialog.c
+++ b/plugins/iradio/rb-station-properties-dialog.c
@@ -42,11 +42,11 @@
#include "rb-dialog.h"
#include "rb-rating.h"
#include "rb-plugin.h"
+#include "rb-util.h"
static void rb_station_properties_dialog_class_init (RBStationPropertiesDialogClass *klass);
static void rb_station_properties_dialog_init (RBStationPropertiesDialog *dialog);
-static GObject *rb_station_properties_dialog_constructor(GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_station_properties_dialog_constructed (GObject *object);
static void rb_station_properties_dialog_dispose (GObject *object);
static void rb_station_properties_dialog_finalize (GObject *object);
static void rb_station_properties_dialog_set_property (GObject *object,
@@ -119,7 +119,7 @@ rb_station_properties_dialog_class_init (RBStationPropertiesDialogClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->constructor = rb_station_properties_dialog_constructor;
+ object_class->constructed = rb_station_properties_dialog_constructed;
object_class->set_property = rb_station_properties_dialog_set_property;
object_class->get_property = rb_station_properties_dialog_get_property;
@@ -152,20 +152,18 @@ rb_station_properties_dialog_init (RBStationPropertiesDialog *dialog)
dialog->priv = RB_STATION_PROPERTIES_DIALOG_GET_PRIVATE (dialog);
}
-static GObject *
-rb_station_properties_dialog_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_station_properties_dialog_constructed (GObject *object)
{
RBStationPropertiesDialog *dialog;
GtkBuilder *builder;
char *builder_file;
AtkObject *lobj, *robj;
- dialog = RB_STATION_PROPERTIES_DIALOG (G_OBJECT_CLASS (rb_station_properties_dialog_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_station_properties_dialog_parent_class, constructed, object);
+ dialog = RB_STATION_PROPERTIES_DIALOG (object);
- g_signal_connect_object (G_OBJECT (dialog),
+ g_signal_connect_object (dialog,
"response",
G_CALLBACK (rb_station_properties_dialog_response_cb),
dialog, 0);
@@ -227,8 +225,6 @@ rb_station_properties_dialog_constructor (GType type,
atk_object_add_relationship (robj, ATK_RELATION_LABELLED_BY, lobj);
g_object_unref (builder);
-
- return G_OBJECT (dialog);
}
static void
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index c5d8c8c..12235ad 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -55,9 +55,7 @@
#define CONF_STATE_PANED_POSITION CONF_PREFIX "/state/mtp/paned_position"
#define CONF_STATE_SHOW_BROWSER CONF_PREFIX "/state/mtp/show_browser"
-static GObject *rb_mtp_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_mtp_source_constructed (GObject *object);
static void rb_mtp_source_dispose (GObject *object);
static void rb_mtp_source_finalize (GObject *object);
@@ -149,7 +147,7 @@ rb_mtp_source_class_init (RBMtpSourceClass *klass)
RBRemovableMediaSourceClass *rms_class = RB_REMOVABLE_MEDIA_SOURCE_CLASS (klass);
RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
- object_class->constructor = rb_mtp_source_constructor;
+ object_class->constructed = rb_mtp_source_constructed;
object_class->dispose = rb_mtp_source_dispose;
object_class->finalize = rb_mtp_source_finalize;
object_class->set_property = rb_mtp_source_set_property;
@@ -223,9 +221,8 @@ rb_mtp_source_init (RBMtpSource *source)
priv->track_transfer_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
}
-static GObject *
-rb_mtp_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_mtp_source_constructed (GObject *object)
{
RBMtpSource *source;
RBMtpSourcePrivate *priv;
@@ -237,9 +234,8 @@ rb_mtp_source_constructor (GType type, guint n_construct_properties,
GdkPixbuf *pixbuf;
gint size;
- source = RB_MTP_SOURCE (G_OBJECT_CLASS (rb_mtp_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
-
+ RB_CHAIN_GOBJECT_METHOD (rb_mtp_source_parent_class, constructed, object);
+ source = RB_MTP_SOURCE (object);
priv = MTP_SOURCE_GET_PRIVATE (source);
/* start the device thread */
@@ -288,8 +284,6 @@ rb_mtp_source_constructor (GType type, guint n_construct_properties,
G_CALLBACK (artwork_notify_cb), source, 0);
g_object_unref (db);
}
-
- return G_OBJECT (source);
}
static void
diff --git a/plugins/status-icon/rb-tray-icon-gtk.c b/plugins/status-icon/rb-tray-icon-gtk.c
index 74d9ac9..0db414b 100644
--- a/plugins/status-icon/rb-tray-icon-gtk.c
+++ b/plugins/status-icon/rb-tray-icon-gtk.c
@@ -61,8 +61,7 @@
static void rb_tray_icon_class_init (RBTrayIconClass *klass);
static void rb_tray_icon_init (RBTrayIcon *tray);
-static GObject *rb_tray_icon_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_tray_icon_constructed (GObject *object);
static void rb_tray_icon_dispose (GObject *object);
static void rb_tray_icon_set_property (GObject *object,
guint prop_id,
@@ -111,7 +110,7 @@ rb_tray_icon_class_init (RBTrayIconClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = rb_tray_icon_dispose;
- object_class->constructor = rb_tray_icon_constructor;
+ object_class->constructed = rb_tray_icon_constructed;
object_class->set_property = rb_tray_icon_set_property;
object_class->get_property = rb_tray_icon_get_property;
@@ -164,18 +163,13 @@ rb_tray_icon_init (RBTrayIcon *tray)
}
-static GObject *
-rb_tray_icon_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_tray_icon_constructed (GObject *object)
{
RBTrayIcon *tray;
- RBTrayIconClass *klass;
-
- klass = RB_TRAY_ICON_CLASS (g_type_class_peek (RB_TYPE_TRAY_ICON));
- tray = RB_TRAY_ICON (G_OBJECT_CLASS (rb_tray_icon_parent_class)->constructor
- (type, n_construct_properties,
- construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_tray_icon_parent_class, constructed, object);
+ tray = RB_TRAY_ICON (object);
g_signal_connect_object (tray->priv->shell_player,
"playing-changed",
@@ -186,8 +180,6 @@ rb_tray_icon_constructor (GType type, guint n_construct_properties,
g_signal_connect_object (tray->priv->icon, "query-tooltip",
G_CALLBACK (rb_status_icon_plugin_set_tooltip),
tray->priv->plugin, 0);
-
- return G_OBJECT (tray);
}
static void
diff --git a/plugins/status-icon/rb-tray-icon.c b/plugins/status-icon/rb-tray-icon.c
index 4f8509c..dca389c 100644
--- a/plugins/status-icon/rb-tray-icon.c
+++ b/plugins/status-icon/rb-tray-icon.c
@@ -65,8 +65,7 @@
static void rb_tray_icon_class_init (RBTrayIconClass *klass);
static void rb_tray_icon_init (RBTrayIcon *icon);
-static GObject *rb_tray_icon_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_tray_icon_constructed (GObject *object);
static void rb_tray_icon_dispose (GObject *object);
static void rb_tray_icon_set_property (GObject *object,
guint prop_id,
@@ -129,7 +128,7 @@ rb_tray_icon_class_init (RBTrayIconClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = rb_tray_icon_dispose;
- object_class->constructor = rb_tray_icon_constructor;
+ object_class->constructed = rb_tray_icon_constructed;
object_class->set_property = rb_tray_icon_set_property;
object_class->get_property = rb_tray_icon_get_property;
@@ -196,18 +195,13 @@ rb_tray_icon_init (RBTrayIcon *icon)
gtk_widget_show_all (GTK_WIDGET (icon->priv->ebox));
}
-static GObject *
-rb_tray_icon_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_tray_icon_constructed (GObject *object)
{
RBTrayIcon *tray;
- RBTrayIconClass *klass;
-
- klass = RB_TRAY_ICON_CLASS (g_type_class_peek (RB_TYPE_TRAY_ICON));
- tray = RB_TRAY_ICON (G_OBJECT_CLASS (rb_tray_icon_parent_class)->constructor
- (type, n_construct_properties,
- construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_tray_icon_parent_class, constructed, object);
+ tray = RB_TRAY_ICON (object);
g_object_get (tray->priv->shell,
"shell-player", &tray->priv->shell_player,
@@ -221,8 +215,6 @@ rb_tray_icon_constructor (GType type, guint n_construct_properties,
g_signal_connect_object (tray, "query-tooltip",
G_CALLBACK (rb_status_icon_plugin_set_tooltip),
tray->priv->plugin, 0);
-
- return G_OBJECT (tray);
}
static void
diff --git a/podcast/rb-podcast-manager.c b/podcast/rb-podcast-manager.c
index eb6c821..a2b7dd1 100644
--- a/podcast/rb-podcast-manager.c
+++ b/podcast/rb-podcast-manager.c
@@ -141,8 +141,7 @@ static guint rb_podcast_manager_signals[LAST_SIGNAL] = { 0 };
/* functions */
static void rb_podcast_manager_class_init (RBPodcastManagerClass *klass);
static void rb_podcast_manager_init (RBPodcastManager *dp);
-static GObject *rb_podcast_manager_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_podcast_manager_constructed (GObject *object);
static void rb_podcast_manager_dispose (GObject *object);
static void rb_podcast_manager_finalize (GObject *object);
static void rb_podcast_manager_set_property (GObject *object,
@@ -195,7 +194,7 @@ rb_podcast_manager_class_init (RBPodcastManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = rb_podcast_manager_constructor;
+ object_class->constructed = rb_podcast_manager_constructed;
object_class->dispose = rb_podcast_manager_dispose;
object_class->finalize = rb_podcast_manager_finalize;
@@ -291,21 +290,14 @@ rb_podcast_manager_init (RBPodcastManager *pd)
eel_gconf_monitor_add (CONF_STATE_PODCAST_PREFIX);
}
-static GObject *
-rb_podcast_manager_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_podcast_manager_constructed (GObject *object)
{
- RBPodcastManager *pd;
-
- pd = RB_PODCAST_MANAGER (G_OBJECT_CLASS (rb_podcast_manager_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
-
+ RBPodcastManager *pd = RB_PODCAST_MANAGER (object);
+ RB_CHAIN_GOBJECT_METHOD (rb_podcast_manager_parent_class, constructed, object);
pd->priv->update_interval_notify_id = eel_gconf_notification_add (CONF_STATE_PODCAST_DOWNLOAD_INTERVAL,
rb_podcast_manager_config_changed,
pd);
-
- return G_OBJECT (pd);
-
}
static void
diff --git a/rhythmdb/rhythmdb-query-model.c b/rhythmdb/rhythmdb-query-model.c
index 0985cd8..ee26fa1 100644
--- a/rhythmdb/rhythmdb-query-model.c
+++ b/rhythmdb/rhythmdb-query-model.c
@@ -67,8 +67,7 @@ G_DEFINE_TYPE_WITH_CODE(RhythmDBQueryModel, rhythmdb_query_model, G_TYPE_OBJECT,
rhythmdb_query_model_drag_dest_init))
static void rhythmdb_query_model_init (RhythmDBQueryModel *shell_player);
-static GObject *rhythmdb_query_model_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rhythmdb_query_model_constructed (GObject *object);
static void rhythmdb_query_model_dispose (GObject *object);
static void rhythmdb_query_model_finalize (GObject *object);
static void rhythmdb_query_model_set_property (GObject *object,
@@ -291,7 +290,7 @@ rhythmdb_query_model_class_init (RhythmDBQueryModelClass *klass)
object_class->dispose = rhythmdb_query_model_dispose;
object_class->finalize = rhythmdb_query_model_finalize;
- object_class->constructor = rhythmdb_query_model_constructor;
+ object_class->constructed = rhythmdb_query_model_constructed;
g_object_class_install_property (object_class,
PROP_RHYTHMDB,
@@ -618,15 +617,13 @@ rhythmdb_query_model_init (RhythmDBQueryModel *model)
model->priv->reorder_drag_and_drop = FALSE;
}
-static GObject *
-rhythmdb_query_model_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rhythmdb_query_model_constructed (GObject *object)
{
RhythmDBQueryModel *model;
- model = RHYTHMDB_QUERY_MODEL (G_OBJECT_CLASS (rhythmdb_query_model_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rhythmdb_query_model_parent_class, constructed, object);
+ model = RHYTHMDB_QUERY_MODEL (object);
g_signal_connect_object (G_OBJECT (model->priv->db),
"entry_added",
@@ -640,8 +637,6 @@ rhythmdb_query_model_constructor (GType type,
"entry_deleted",
G_CALLBACK (rhythmdb_query_model_entry_deleted_cb),
model, 0);
-
- return G_OBJECT (model);
}
static void
diff --git a/shell/rb-play-order.c b/shell/rb-play-order.c
index 0dd5625..430f3c8 100644
--- a/shell/rb-play-order.c
+++ b/shell/rb-play-order.c
@@ -63,8 +63,6 @@
static void rb_play_order_class_init (RBPlayOrderClass *klass);
static void rb_play_order_init (RBPlayOrder *porder);
-static GObject *rb_play_order_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
static void rb_play_order_dispose (GObject *object);
static void rb_play_order_finalize (GObject *object);
static void rb_play_order_set_property (GObject *object,
@@ -129,7 +127,6 @@ rb_play_order_class_init (RBPlayOrderClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = rb_play_order_constructor;
object_class->dispose = rb_play_order_dispose;
object_class->finalize = rb_play_order_finalize;
object_class->set_property = rb_play_order_set_property;
@@ -194,19 +191,6 @@ rb_play_order_init (RBPlayOrder *porder)
porder->priv = RB_PLAY_ORDER_GET_PRIVATE (porder);
}
-static GObject *
-rb_play_order_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
-{
- RBPlayOrder *porder;
-
- porder = RB_PLAY_ORDER (G_OBJECT_CLASS (rb_play_order_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
-
- return G_OBJECT (porder);
-}
-
static void
rb_play_order_dispose (GObject *object)
{
diff --git a/shell/rb-shell-clipboard.c b/shell/rb-shell-clipboard.c
index ee1b8ab..0f11a5f 100644
--- a/shell/rb-shell-clipboard.c
+++ b/shell/rb-shell-clipboard.c
@@ -61,8 +61,6 @@
static void rb_shell_clipboard_class_init (RBShellClipboardClass *klass);
static void rb_shell_clipboard_init (RBShellClipboard *shell_clipboard);
-static GObject *rb_shell_clipboard_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
static void rb_shell_clipboard_dispose (GObject *object);
static void rb_shell_clipboard_finalize (GObject *object);
static void rb_shell_clipboard_set_property (GObject *object,
@@ -207,7 +205,6 @@ rb_shell_clipboard_class_init (RBShellClipboardClass *klass)
object_class->dispose = rb_shell_clipboard_dispose;
object_class->finalize = rb_shell_clipboard_finalize;
- object_class->constructor = rb_shell_clipboard_constructor;
object_class->set_property = rb_shell_clipboard_set_property;
object_class->get_property = rb_shell_clipboard_get_property;
@@ -335,29 +332,6 @@ rb_shell_clipboard_finalize (GObject *object)
G_OBJECT_CLASS (rb_shell_clipboard_parent_class)->finalize (object);
}
-static GObject *
-rb_shell_clipboard_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
-{
- RBShellClipboard *clip;
- RBShellClipboardClass *klass;
- GObjectClass *parent_class;
-
- klass = RB_SHELL_CLIPBOARD_CLASS (g_type_class_peek (RB_TYPE_SHELL_CLIPBOARD));
-
- parent_class = G_OBJECT_CLASS (rb_shell_clipboard_parent_class);
- clip = RB_SHELL_CLIPBOARD (parent_class->constructor (type,
- n_construct_properties,
- construct_properties));
-
- g_signal_connect_object (G_OBJECT (clip->priv->db),
- "entry_deleted",
- G_CALLBACK (rb_shell_clipboard_entry_deleted_cb),
- clip, 0);
-
- return G_OBJECT (clip);
-}
-
static void
rb_shell_clipboard_set_source_internal (RBShellClipboard *clipboard,
RBSource *source)
@@ -417,6 +391,10 @@ rb_shell_clipboard_set_property (GObject *object,
break;
case PROP_DB:
clipboard->priv->db = g_value_get_object (value);
+ g_signal_connect_object (clipboard->priv->db,
+ "entry_deleted",
+ G_CALLBACK (rb_shell_clipboard_entry_deleted_cb),
+ clipboard, 0);
break;
case PROP_UI_MANAGER:
clipboard->priv->ui_mgr = g_value_get_object (value);
diff --git a/shell/rb-shell-player.c b/shell/rb-shell-player.c
index 61c89a3..7042c3a 100644
--- a/shell/rb-shell-player.c
+++ b/shell/rb-shell-player.c
@@ -104,8 +104,7 @@ static const char* const state_to_play_order[2][2] =
static void rb_shell_player_class_init (RBShellPlayerClass *klass);
static void rb_shell_player_init (RBShellPlayer *shell_player);
-static GObject *rb_shell_player_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_shell_player_constructed (GObject *object);
static void rb_shell_player_dispose (GObject *object);
static void rb_shell_player_finalize (GObject *object);
static void rb_shell_player_set_property (GObject *object,
@@ -349,7 +348,7 @@ rb_shell_player_class_init (RBShellPlayerClass *klass)
object_class->dispose = rb_shell_player_dispose;
object_class->finalize = rb_shell_player_finalize;
- object_class->constructor = rb_shell_player_constructor;
+ object_class->constructed = rb_shell_player_constructed;
object_class->set_property = rb_shell_player_set_property;
object_class->get_property = rb_shell_player_get_property;
@@ -625,19 +624,15 @@ rb_shell_player_class_init (RBShellPlayerClass *klass)
g_type_class_add_private (klass, sizeof (RBShellPlayerPrivate));
}
-static GObject *
-rb_shell_player_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_shell_player_constructed (GObject *object)
{
RBShellPlayer *player;
- RBShellPlayerClass *klass;
GtkAction *action;
- klass = RB_SHELL_PLAYER_CLASS (g_type_class_peek (RB_TYPE_SHELL_PLAYER));
+ RB_CHAIN_GOBJECT_METHOD (rb_shell_player_parent_class, constructed, object);
- player = RB_SHELL_PLAYER (G_OBJECT_CLASS (rb_shell_player_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ player = RB_SHELL_PLAYER (object);
player->priv->header_widget = rb_header_new (player, player->priv->db);
gtk_widget_show (GTK_WIDGET (player->priv->header_widget));
@@ -673,8 +668,6 @@ rb_shell_player_constructor (GType type,
"notify::playing",
G_CALLBACK (rb_shell_player_playing_changed_cb),
NULL);
-
- return G_OBJECT (player);
}
static void
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index c15eeab..154e646 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -93,9 +93,7 @@
static void rb_shell_class_init (RBShellClass *klass);
static void rb_shell_init (RBShell *shell);
-static GObject *rb_shell_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_shell_constructed (GObject *object);
static void rb_shell_finalize (GObject *object);
static void rb_shell_set_property (GObject *object,
guint prop_id,
@@ -454,7 +452,7 @@ rb_shell_class_init (RBShellClass *klass)
object_class->set_property = rb_shell_set_property;
object_class->get_property = rb_shell_get_property;
object_class->finalize = rb_shell_finalize;
- object_class->constructor = rb_shell_constructor;
+ object_class->constructed = rb_shell_constructed;
klass->visibility_changing = rb_shell_visibility_changing;
@@ -1312,15 +1310,14 @@ _scan_idle (RBShell *shell)
return FALSE;
}
-static GObject *
-rb_shell_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_shell_constructed (GObject *object)
{
RBShell *shell;
- shell = RB_SHELL (((GObjectClass*)rb_shell_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_shell_parent_class, constructed, object);
+
+ shell = RB_SHELL (object);
rb_debug ("Constructing shell");
rb_profile_start ("constructing shell");
@@ -1431,8 +1428,6 @@ rb_shell_constructor (GType type,
}
rb_profile_end ("constructing shell");
-
- return G_OBJECT (shell);
}
static gboolean
diff --git a/shell/rb-source-header.c b/shell/rb-source-header.c
index 762e805..93e73f5 100644
--- a/shell/rb-source-header.c
+++ b/shell/rb-source-header.c
@@ -200,27 +200,6 @@ ui_manager_add_widget_cb (GtkUIManager *ui_manager,
}
}
-static GObject *
-rb_source_header_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
-{
- RBSourceHeader *header;
- RBSourceHeaderClass *klass;
-
- klass = RB_SOURCE_HEADER_CLASS (g_type_class_peek (RB_TYPE_SOURCE_HEADER));
-
- header = RB_SOURCE_HEADER (G_OBJECT_CLASS (rb_source_header_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
-
- g_signal_connect (G_OBJECT (header->priv->ui_manager), "add_widget",
- G_CALLBACK (ui_manager_add_widget_cb), header);
-
- header->priv->source_ui_merge_id = gtk_ui_manager_new_merge_id (header->priv->ui_manager);
-
- return G_OBJECT (header);
-}
-
static void
rb_source_header_class_init (RBSourceHeaderClass *klass)
{
@@ -228,7 +207,6 @@ rb_source_header_class_init (RBSourceHeaderClass *klass)
object_class->finalize = rb_source_header_finalize;
object_class->dispose = rb_source_header_dispose;
- object_class->constructor = rb_source_header_constructor;
object_class->set_property = rb_source_header_set_property;
object_class->get_property = rb_source_header_get_property;
@@ -587,6 +565,10 @@ rb_source_header_set_property (GObject *object,
break;
case PROP_UI_MANAGER:
header->priv->ui_manager = g_value_get_object (value);
+ g_signal_connect (G_OBJECT (header->priv->ui_manager), "add_widget",
+ G_CALLBACK (ui_manager_add_widget_cb), header);
+
+ header->priv->source_ui_merge_id = gtk_ui_manager_new_merge_id (header->priv->ui_manager);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/shell/rb-statusbar.c b/shell/rb-statusbar.c
index ad55921..bc610b4 100644
--- a/shell/rb-statusbar.c
+++ b/shell/rb-statusbar.c
@@ -61,9 +61,6 @@
#define EPSILON (0.00001)
-static GObject* rb_statusbar_construct (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
static void rb_statusbar_class_init (RBStatusbarClass *klass);
static void rb_statusbar_init (RBStatusbar *statusbar);
static void rb_statusbar_dispose (GObject *object);
@@ -115,7 +112,6 @@ rb_statusbar_class_init (RBStatusbarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = rb_statusbar_construct;
object_class->dispose = rb_statusbar_dispose;
object_class->finalize = rb_statusbar_finalize;
@@ -162,26 +158,6 @@ rb_statusbar_class_init (RBStatusbarClass *klass)
g_type_class_add_private (klass, sizeof (RBStatusbarPrivate));
}
-static GObject*
-rb_statusbar_construct (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
-{
- RBStatusbarClass *klass;
- GObject *object;
- RBStatusbar *statusbar;
-
- klass = RB_STATUSBAR_CLASS (g_type_class_peek (RB_TYPE_STATUSBAR));
- object = G_OBJECT_CLASS (rb_statusbar_parent_class)->constructor
- (type,
- n_construct_properties,
- construct_properties);
-
- statusbar = RB_STATUSBAR (object);
-
- return object;
-}
-
static void
rb_statusbar_init (RBStatusbar *statusbar)
{
diff --git a/sources/rb-auto-playlist-source.c b/sources/rb-auto-playlist-source.c
index 834a62c..300f906 100644
--- a/sources/rb-auto-playlist-source.c
+++ b/sources/rb-auto-playlist-source.c
@@ -62,8 +62,7 @@
* results.
*/
-static GObject *rb_auto_playlist_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_auto_playlist_source_constructed (GObject *object);
static void rb_auto_playlist_source_dispose (GObject *object);
static void rb_auto_playlist_source_finalize (GObject *object);
static void rb_auto_playlist_source_set_property (GObject *object,
@@ -151,7 +150,7 @@ rb_auto_playlist_source_class_init (RBAutoPlaylistSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBPlaylistSourceClass *playlist_class = RB_PLAYLIST_SOURCE_CLASS (klass);
- object_class->constructor = rb_auto_playlist_source_constructor;
+ object_class->constructed = rb_auto_playlist_source_constructed;
object_class->dispose = rb_auto_playlist_source_dispose;
object_class->finalize = rb_auto_playlist_source_finalize;
object_class->set_property = rb_auto_playlist_source_set_property;
@@ -242,19 +241,18 @@ rb_auto_playlist_source_finalize (GObject *object)
G_OBJECT_CLASS (rb_auto_playlist_source_parent_class)->finalize (object);
}
-static GObject *
-rb_auto_playlist_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_auto_playlist_source_constructed (GObject *object)
{
RBEntryView *songs;
RBAutoPlaylistSource *source;
- GObjectClass *parent_class = G_OBJECT_CLASS (rb_auto_playlist_source_parent_class);
RBAutoPlaylistSourcePrivate *priv;
RBShell *shell;
RhythmDBEntryType entry_type;
- source = RB_AUTO_PLAYLIST_SOURCE (
- parent_class->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_auto_playlist_source_parent_class, constructed, object);
+
+ source = RB_AUTO_PLAYLIST_SOURCE (object);
priv = GET_PRIVATE (source);
priv->paned = gtk_vpaned_new ();
@@ -302,8 +300,6 @@ rb_auto_playlist_source_constructor (GType type, guint n_construct_properties,
g_object_unref (songs);
gtk_widget_show_all (GTK_WIDGET (source));
-
- return G_OBJECT (source);
}
/**
diff --git a/sources/rb-browser-source.c b/sources/rb-browser-source.c
index f9cafb4..93a6a50 100644
--- a/sources/rb-browser-source.c
+++ b/sources/rb-browser-source.c
@@ -68,9 +68,7 @@
static void rb_browser_source_class_init (RBBrowserSourceClass *klass);
static void rb_browser_source_init (RBBrowserSource *source);
-static GObject *rb_browser_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_browser_source_constructed (GObject *object);
static void rb_browser_source_dispose (GObject *object);
static void rb_browser_source_finalize (GObject *object);
static void rb_browser_source_set_property (GObject *object,
@@ -200,7 +198,7 @@ rb_browser_source_class_init (RBBrowserSourceClass *klass)
object_class->dispose = rb_browser_source_dispose;
object_class->finalize = rb_browser_source_finalize;
- object_class->constructor = rb_browser_source_constructor;
+ object_class->constructed = rb_browser_source_constructed;
object_class->set_property = rb_browser_source_set_property;
object_class->get_property = rb_browser_source_get_property;
@@ -341,10 +339,8 @@ default_show_entry_popup (RBBrowserSource *source)
_rb_source_show_popup (RB_SOURCE (source), "/BrowserSourceViewPopup");
}
-static GObject *
-rb_browser_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_browser_source_constructed (GObject *object)
{
RBBrowserSource *source;
RBBrowserSourceClass *klass;
@@ -354,8 +350,9 @@ rb_browser_source_constructor (GType type,
char *paned_key;
RhythmDBEntryType entry_type;
- source = RB_BROWSER_SOURCE (G_OBJECT_CLASS (rb_browser_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_browser_source_parent_class, constructed, object);
+
+ source = RB_BROWSER_SOURCE (object);
g_object_get (source,
"shell", &shell,
@@ -487,8 +484,6 @@ rb_browser_source_constructor (GType type,
rb_browser_source_populate (source);
g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type);
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-import-errors-source.c b/sources/rb-import-errors-source.c
index 8a7b07a..c7ebbd5 100644
--- a/sources/rb-import-errors-source.c
+++ b/sources/rb-import-errors-source.c
@@ -36,8 +36,7 @@
static void rb_import_errors_source_class_init (RBImportErrorsSourceClass *klass);
static void rb_import_errors_source_init (RBImportErrorsSource *source);
-static GObject *rb_import_errors_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_import_errors_source_constructed (GObject *object);
static void rb_import_errors_source_dispose (GObject *object);
static RBEntryView *impl_get_entry_view (RBSource *source);
@@ -86,7 +85,7 @@ rb_import_errors_source_class_init (RBImportErrorsSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
object_class->dispose = rb_import_errors_source_dispose;
- object_class->constructor = rb_import_errors_source_constructor;
+ object_class->constructed = rb_import_errors_source_constructed;
source_class->impl_can_browse = (RBSourceFeatureFunc) rb_false_function;
source_class->impl_get_entry_view = impl_get_entry_view;
@@ -127,22 +126,19 @@ rb_import_errors_source_init (RBImportErrorsSource *source)
}
}
-static GObject *
-rb_import_errors_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_import_errors_source_constructed (GObject *object)
{
GObject *shell_player;
RBImportErrorsSource *source;
- RBImportErrorsSourceClass *klass;
RBShell *shell;
GPtrArray *query;
RhythmDBQueryModel *model;
RhythmDBEntryType entry_type;
- klass = RB_IMPORT_ERRORS_SOURCE_CLASS (g_type_class_peek (RB_TYPE_IMPORT_ERRORS_SOURCE));
+ RB_CHAIN_GOBJECT_METHOD (rb_import_errors_source_parent_class, constructed, object);
- source = RB_IMPORT_ERRORS_SOURCE (G_OBJECT_CLASS (rb_import_errors_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ source = RB_IMPORT_ERRORS_SOURCE (object);
g_object_get (source,
"shell", &shell,
@@ -183,8 +179,6 @@ rb_import_errors_source_constructor (GType type, guint n_construct_properties,
g_object_set (source, "query-model", model, NULL);
g_object_unref (model);
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index e3a74f5..fa0d83b 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -70,9 +70,7 @@
static void rb_library_source_class_init (RBLibrarySourceClass *klass);
static void rb_library_source_init (RBLibrarySource *source);
-static GObject *rb_library_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_library_source_constructed (GObject *object);
static void rb_library_source_dispose (GObject *object);
static void rb_library_source_finalize (GObject *object);
@@ -188,7 +186,7 @@ rb_library_source_class_init (RBLibrarySourceClass *klass)
object_class->dispose = rb_library_source_dispose;
object_class->finalize = rb_library_source_finalize;
- object_class->constructor = rb_library_source_constructor;
+ object_class->constructed = rb_library_source_constructed;
source_class->impl_show_popup = impl_show_popup;
source_class->impl_get_config_widget = impl_get_config_widget;
@@ -287,18 +285,16 @@ db_load_complete_cb (RhythmDB *db, RBLibrarySource *source)
g_object_set (source, "populate", TRUE, NULL);
}
-static GObject *
-rb_library_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_library_source_constructed (GObject *object)
{
RBLibrarySource *source;
RBShell *shell;
RBEntryView *songs;
GSList *list;
- source = RB_LIBRARY_SOURCE (G_OBJECT_CLASS (rb_library_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_library_source_parent_class, constructed, object);
+ source = RB_LIBRARY_SOURCE (object);
g_object_get (source, "shell", &shell, NULL);
g_object_get (shell, "db", &source->priv->db, NULL);
@@ -359,8 +355,6 @@ rb_library_source_constructor (GType type,
g_idle_add ((GSourceFunc)add_child_sources_idle, source);
g_object_unref (shell);
-
- return G_OBJECT (source);
}
/**
diff --git a/sources/rb-missing-files-source.c b/sources/rb-missing-files-source.c
index d8680fc..4db4ae6 100644
--- a/sources/rb-missing-files-source.c
+++ b/sources/rb-missing-files-source.c
@@ -53,8 +53,7 @@
static void rb_missing_files_source_class_init (RBMissingFilesSourceClass *klass);
static void rb_missing_files_source_init (RBMissingFilesSource *source);
-static GObject *rb_missing_files_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_missing_files_source_constructed (GObject *object);
static void rb_missing_files_source_dispose (GObject *object);
static void rb_missing_files_source_set_property (GObject *object,
guint prop_id,
@@ -93,7 +92,7 @@ rb_missing_files_source_class_init (RBMissingFilesSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
object_class->dispose = rb_missing_files_source_dispose;
- object_class->constructor = rb_missing_files_source_constructor;
+ object_class->constructed = rb_missing_files_source_constructed;
object_class->set_property = rb_missing_files_source_set_property;
object_class->get_property = rb_missing_files_source_get_property;
@@ -138,22 +137,18 @@ rb_missing_files_source_init (RBMissingFilesSource *source)
}
}
-static GObject *
-rb_missing_files_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_missing_files_source_constructed (GObject *object)
{
GObject *shell_player;
RBMissingFilesSource *source;
- RBMissingFilesSourceClass *klass;
RBShell *shell;
GPtrArray *query;
RhythmDBQueryModel *model;
RhythmDBEntryType entry_type;
- klass = RB_MISSING_FILES_SOURCE_CLASS (g_type_class_peek (RB_TYPE_MISSING_FILES_SOURCE));
-
- source = RB_MISSING_FILES_SOURCE (G_OBJECT_CLASS (rb_missing_files_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_missing_files_source_parent_class, constructed, object);
+ source = RB_MISSING_FILES_SOURCE (object);
g_object_get (source,
"shell", &shell,
@@ -207,8 +202,6 @@ rb_missing_files_source_constructor (GType type, guint n_construct_properties,
g_object_set (source, "query-model", model, NULL);
g_object_unref (model);
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-play-queue-source.c b/sources/rb-play-queue-source.c
index 50142f5..7c57cfd 100644
--- a/sources/rb-play-queue-source.c
+++ b/sources/rb-play-queue-source.c
@@ -53,8 +53,7 @@
*/
-static GObject *rb_play_queue_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_play_queue_source_constructed (GObject *object);
static void rb_play_queue_source_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -164,7 +163,7 @@ rb_play_queue_source_class_init (RBPlayQueueSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBPlaylistSourceClass *playlist_class = RB_PLAYLIST_SOURCE_CLASS (klass);
- object_class->constructor = rb_play_queue_source_constructor;
+ object_class->constructed = rb_play_queue_source_constructed;
object_class->get_property = rb_play_queue_source_get_property;
object_class->finalize = rb_play_queue_source_finalize;
object_class->dispose = rb_play_queue_source_dispose;
@@ -208,22 +207,24 @@ rb_play_queue_source_init (RBPlayQueueSource *source)
{
}
-static GObject *
-rb_play_queue_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_play_queue_source_constructed (GObject *object)
{
- GObjectClass *parent_class = G_OBJECT_CLASS (rb_play_queue_source_parent_class);
- RBPlayQueueSource *source = RB_PLAY_QUEUE_SOURCE (
- parent_class->constructor (type, n_construct_properties, construct_properties));
- RBPlayQueueSourcePrivate *priv = RB_PLAY_QUEUE_SOURCE_GET_PRIVATE (source);
+ RBPlayQueueSource *source;
+ RBPlayQueueSourcePrivate *priv;
GObject *shell_player;
RBShell *shell;
- RhythmDB *db = rb_playlist_source_get_db (RB_PLAYLIST_SOURCE (source));
+ RhythmDB *db;
GtkCellRenderer *renderer;
RhythmDBQueryModel *model;
GtkAction *action;
+ RB_CHAIN_GOBJECT_METHOD (rb_play_queue_source_parent_class, constructed, object);
+
+ source = RB_PLAY_QUEUE_SOURCE (object);
+ priv = RB_PLAY_QUEUE_SOURCE_GET_PRIVATE (source);
+ db = rb_playlist_source_get_db (RB_PLAYLIST_SOURCE (source));
+
g_object_get (source, "shell", &shell, NULL);
shell_player = rb_shell_get_player (shell);
g_object_unref (shell);
@@ -277,8 +278,6 @@ rb_play_queue_source_constructor (GType type,
source, 0);
rb_play_queue_source_update_count (source, GTK_TREE_MODEL (model), 0);
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-playlist-source.c b/sources/rb-playlist-source.c
index a36575a..03e5e0f 100644
--- a/sources/rb-playlist-source.c
+++ b/sources/rb-playlist-source.c
@@ -74,9 +74,7 @@
static void rb_playlist_source_class_init (RBPlaylistSourceClass *klass);
static void rb_playlist_source_init (RBPlaylistSource *source);
-static GObject *rb_playlist_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_playlist_source_constructed (GObject *object);
static void rb_playlist_source_dispose (GObject *object);
static void rb_playlist_source_finalize (GObject *object);
static void rb_playlist_source_set_property (GObject *object,
@@ -167,7 +165,7 @@ rb_playlist_source_class_init (RBPlaylistSourceClass *klass)
object_class->dispose = rb_playlist_source_dispose;
object_class->finalize = rb_playlist_source_finalize;
- object_class->constructor = rb_playlist_source_constructor;
+ object_class->constructed = rb_playlist_source_constructed;
object_class->set_property = rb_playlist_source_set_property;
object_class->get_property = rb_playlist_source_get_property;
@@ -271,23 +269,18 @@ rb_playlist_source_set_db (RBPlaylistSource *source,
}
-static GObject *
-rb_playlist_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_playlist_source_constructed (GObject *object)
{
GObject *shell_player;
RBPlaylistSource *source;
- RBPlaylistSourceClass *klass;
RBShell *shell;
RhythmDB *db;
RhythmDBQueryModel *query_model;
char *sorting_key;
- klass = RB_PLAYLIST_SOURCE_CLASS (g_type_class_peek (RB_TYPE_PLAYLIST_SOURCE));
-
- source = RB_PLAYLIST_SOURCE (G_OBJECT_CLASS (rb_playlist_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_playlist_source_parent_class, constructed, object);
+ source = RB_PLAYLIST_SOURCE (object);
g_object_get (source, "shell", &shell, NULL);
g_object_get (shell, "db", &db, NULL);
@@ -366,8 +359,6 @@ rb_playlist_source_constructor (GType type,
gtk_container_add (GTK_CONTAINER (source), GTK_WIDGET (source->priv->songs));
gtk_widget_show_all (GTK_WIDGET (source));
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-podcast-source.c b/sources/rb-podcast-source.c
index e291a1b..64fbf42 100644
--- a/sources/rb-podcast-source.c
+++ b/sources/rb-podcast-source.c
@@ -77,9 +77,7 @@ static void rb_podcast_source_class_init (RBPodcastSourceClass *klass);
static void rb_podcast_source_init (RBPodcastSource *source);
-static GObject *rb_podcast_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_podcast_source_constructed (GObject *object);
static void rb_podcast_source_dispose (GObject *object);
@@ -358,7 +356,7 @@ rb_podcast_source_class_init (RBPodcastSourceClass *klass)
object_class->dispose = rb_podcast_source_dispose;
object_class->finalize = rb_podcast_source_finalize;
- object_class->constructor = rb_podcast_source_constructor;
+ object_class->constructed = rb_podcast_source_constructed;
object_class->set_property = rb_podcast_source_set_property;
object_class->get_property = rb_podcast_source_get_property;
@@ -493,13 +491,10 @@ rb_podcast_source_finalize (GObject *object)
G_OBJECT_CLASS (rb_podcast_source_parent_class)->finalize (object);
}
-static GObject *
-rb_podcast_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_podcast_source_constructed (GObject *object)
{
RBPodcastSource *source;
- RBPodcastSourceClass *klass;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
RBShell *shell;
@@ -507,10 +502,8 @@ rb_podcast_source_constructor (GType type,
GPtrArray *query;
GtkAction *action;
- klass = RB_PODCAST_SOURCE_CLASS (g_type_class_peek (RB_TYPE_PODCAST_SOURCE));
-
- source = RB_PODCAST_SOURCE (G_OBJECT_CLASS (rb_podcast_source_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_podcast_source_parent_class, constructed, object);
+ source = RB_PODCAST_SOURCE (object);
g_object_get (source, "shell", &shell, NULL);
g_object_get (shell, "db", &source->priv->db, NULL);
@@ -785,8 +778,6 @@ rb_podcast_source_constructor (GType type,
rb_podcast_source_state_prefs_sync (source);
rb_podcast_source_do_query (source);
-
- return G_OBJECT (source);
}
static void
diff --git a/sources/rb-removable-media-source.c b/sources/rb-removable-media-source.c
index 6ef4a4d..d004fa3 100644
--- a/sources/rb-removable-media-source.c
+++ b/sources/rb-removable-media-source.c
@@ -47,9 +47,7 @@
#include "rb-util.h"
#include "rb-file-helpers.h"
-static GObject *rb_removable_media_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_removable_media_source_constructed (GObject *object);
static void rb_removable_media_source_dispose (GObject *object);
static void rb_removable_media_source_set_property (GObject *object,
@@ -92,7 +90,7 @@ rb_removable_media_source_class_init (RBRemovableMediaSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBBrowserSourceClass *browser_source_class = RB_BROWSER_SOURCE_CLASS (klass);
- object_class->constructor = rb_removable_media_source_constructor;
+ object_class->constructed = rb_removable_media_source_constructed;
object_class->dispose = rb_removable_media_source_dispose;
object_class->set_property = rb_removable_media_source_set_property;
object_class->get_property = rb_removable_media_source_get_property;
@@ -139,20 +137,17 @@ rb_removable_media_source_init (RBRemovableMediaSource *self)
{
}
-static GObject *
-rb_removable_media_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_removable_media_source_constructed (GObject *object)
{
- GObject *source;
GMount *mount;
GIcon *icon = NULL;
char *display_name;
GdkPixbuf *pixbuf = NULL;
RBRemovableMediaSourcePrivate *priv;
- source = G_OBJECT_CLASS(rb_removable_media_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties);
- priv = REMOVABLE_MEDIA_SOURCE_GET_PRIVATE (source);
+ RB_CHAIN_GOBJECT_METHOD (rb_removable_media_source_parent_class, constructed, object);
+ priv = REMOVABLE_MEDIA_SOURCE_GET_PRIVATE (object);
/* prefer mount details to volume details, as the nautilus sidebar does */
if (priv->mount != NULL) {
@@ -176,7 +171,7 @@ rb_removable_media_source_constructor (GType type, guint n_construct_properties,
icon = g_themed_icon_new ("multimedia-player");
}
- g_object_set (source, "name", display_name, NULL);
+ g_object_set (object, "name", display_name, NULL);
g_free (display_name);
if (icon == NULL) {
@@ -204,7 +199,7 @@ rb_removable_media_source_constructor (GType type, guint n_construct_properties,
pixbuf = NULL;
}
- rb_source_set_pixbuf (RB_SOURCE (source), pixbuf);
+ rb_source_set_pixbuf (RB_SOURCE (object), pixbuf);
if (pixbuf != NULL) {
g_object_unref (pixbuf);
}
@@ -212,8 +207,6 @@ rb_removable_media_source_constructor (GType type, guint n_construct_properties,
g_object_unref (mount);
}
g_object_unref (icon);
-
- return source;
}
static void
diff --git a/sources/rb-sourcelist.c b/sources/rb-sourcelist.c
index 898e538..bcb0ac6 100644
--- a/sources/rb-sourcelist.c
+++ b/sources/rb-sourcelist.c
@@ -105,9 +105,7 @@ enum
static void rb_sourcelist_class_init (RBSourceListClass *klass);
static void rb_sourcelist_init (RBSourceList *sourcelist);
-static GObject * rb_sourcelist_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_sourcelist_constructed (GObject *object);
static void rb_sourcelist_finalize (GObject *object);
static void rb_sourcelist_set_property (GObject *object,
guint prop_id,
@@ -141,7 +139,7 @@ rb_sourcelist_class_init (RBSourceListClass *class)
o_class = (GObjectClass *) class;
object_class = (GtkObjectClass *) class;
- o_class->constructor = rb_sourcelist_constructor;
+ o_class->constructed = rb_sourcelist_constructed;
o_class->finalize = rb_sourcelist_finalize;
o_class->set_property = rb_sourcelist_set_property;
o_class->get_property = rb_sourcelist_get_property;
@@ -249,20 +247,16 @@ rb_sourcelist_class_init (RBSourceListClass *class)
g_type_class_add_private (class, sizeof (RBSourceListPrivate));
}
-static GObject *
-rb_sourcelist_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_sourcelist_constructed (GObject *object)
{
RBSourceList *sourcelist;
- sourcelist = RB_SOURCELIST (G_OBJECT_CLASS (rb_sourcelist_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_sourcelist_parent_class, constructed, object);
+ sourcelist = RB_SOURCELIST (object);
gtk_container_add (GTK_CONTAINER (sourcelist),
sourcelist->priv->treeview);
-
- return G_OBJECT (sourcelist);
}
static void
diff --git a/sources/rb-static-playlist-source.c b/sources/rb-static-playlist-source.c
index 4cd3977..70139dd 100644
--- a/sources/rb-static-playlist-source.c
+++ b/sources/rb-static-playlist-source.c
@@ -44,8 +44,7 @@
#include "rb-playlist-xml.h"
#include "rb-source-search-basic.h"
-static GObject *rb_static_playlist_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_static_playlist_source_constructed (GObject *object);
static void rb_static_playlist_source_dispose (GObject *object);
static void rb_static_playlist_source_finalize (GObject *object);
static void rb_static_playlist_source_set_property (GObject *object,
@@ -149,7 +148,7 @@ rb_static_playlist_source_class_init (RBStaticPlaylistSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
RBPlaylistSourceClass *playlist_class = RB_PLAYLIST_SOURCE_CLASS (klass);
- object_class->constructor = rb_static_playlist_source_constructor;
+ object_class->constructed = rb_static_playlist_source_constructed;
object_class->dispose = rb_static_playlist_source_dispose;
object_class->finalize = rb_static_playlist_source_finalize;
object_class->set_property = rb_static_playlist_source_set_property;
@@ -256,20 +255,22 @@ rb_static_playlist_source_finalize (GObject *object)
G_OBJECT_CLASS (rb_static_playlist_source_parent_class)->finalize (object);
}
-static GObject *
-rb_static_playlist_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_static_playlist_source_constructed (GObject *object)
{
- GObjectClass *parent_class = G_OBJECT_CLASS (rb_static_playlist_source_parent_class);
- RBStaticPlaylistSource *source = RB_STATIC_PLAYLIST_SOURCE (
- parent_class->constructor (type, n_construct_properties, construct_properties));
- RBStaticPlaylistSourcePrivate *priv = RB_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (source);
- RBPlaylistSource *psource = RB_PLAYLIST_SOURCE (source);
+ RBStaticPlaylistSource *source;
+ RBStaticPlaylistSourcePrivate *priv;
+ RBPlaylistSource *psource;
RBEntryView *songs;
RBShell *shell;
RhythmDBEntryType entry_type;
+ RB_CHAIN_GOBJECT_METHOD (rb_static_playlist_source_parent_class, constructed, object);
+
+ source = RB_STATIC_PLAYLIST_SOURCE (object);
+ priv = RB_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (source);
+ psource = RB_PLAYLIST_SOURCE (source);
+
priv->base_model = rb_playlist_source_get_query_model (RB_PLAYLIST_SOURCE (psource));
g_object_set (priv->base_model, "show-hidden", TRUE, NULL);
g_object_ref (priv->base_model);
@@ -333,8 +334,6 @@ rb_static_playlist_source_constructor (GType type,
source, 0);
gtk_widget_show_all (GTK_WIDGET (source));
-
- return G_OBJECT (source);
}
RBSource *
diff --git a/sources/rb-streaming-source.c b/sources/rb-streaming-source.c
index 364a7c1..3027e1e 100644
--- a/sources/rb-streaming-source.c
+++ b/sources/rb-streaming-source.c
@@ -59,8 +59,7 @@
static void rb_streaming_source_class_init (RBStreamingSourceClass *klass);
static void rb_streaming_source_init (RBStreamingSource *source);
-static GObject *rb_streaming_source_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_streaming_source_constructed (GObject *object);
static void rb_streaming_source_dispose (GObject *object);
/* source methods */
@@ -112,7 +111,7 @@ rb_streaming_source_class_init (RBStreamingSourceClass *klass)
RBSourceClass *source_class = RB_SOURCE_CLASS (klass);
object_class->dispose = rb_streaming_source_dispose;
- object_class->constructor = rb_streaming_source_constructor;
+ object_class->constructed = rb_streaming_source_constructed;
source_class->impl_can_copy = (RBSourceFeatureFunc) rb_false_function;
source_class->impl_can_delete = (RBSourceFeatureFunc) rb_true_function;
@@ -151,19 +150,14 @@ rb_streaming_source_dispose (GObject *object)
G_OBJECT_CLASS (rb_streaming_source_parent_class)->dispose (object);
}
-static GObject *
-rb_streaming_source_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_streaming_source_constructed (GObject *object)
{
RBStreamingSource *source;
- RBStreamingSourceClass *klass;
RBShell *shell;
- klass = RB_STREAMING_SOURCE_CLASS (g_type_class_peek (RB_TYPE_STREAMING_SOURCE));
-
- source = RB_STREAMING_SOURCE (G_OBJECT_CLASS (rb_streaming_source_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_streaming_source_parent_class, constructed, object);
+ source = RB_STREAMING_SOURCE (object);
g_object_get (G_OBJECT (source), "shell", &shell, NULL);
g_object_get (G_OBJECT (shell),
@@ -198,8 +192,6 @@ rb_streaming_source_constructor (GType type,
g_signal_connect_object (source->priv->player, "playing-song-changed",
G_CALLBACK (playing_entry_changed_cb),
source, 0);
-
- return G_OBJECT (source);
}
static RBSourceEOFType
diff --git a/widgets/rb-entry-view.c b/widgets/rb-entry-view.c
index 461d1bb..ad8360a 100644
--- a/widgets/rb-entry-view.c
+++ b/widgets/rb-entry-view.c
@@ -106,8 +106,7 @@ struct RBEntryViewColumnSortData
static void rb_entry_view_class_init (RBEntryViewClass *klass);
static void rb_entry_view_init (RBEntryView *view);
-static GObject *rb_entry_view_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_entry_view_constructed (GObject *object);
static void rb_entry_view_dispose (GObject *object);
static void rb_entry_view_finalize (GObject *object);
static void rb_entry_view_sort_data_finalize (gpointer column,
@@ -277,7 +276,7 @@ rb_entry_view_class_init (RBEntryViewClass *klass)
object_class->dispose = rb_entry_view_dispose;
object_class->finalize = rb_entry_view_finalize;
- object_class->constructor = rb_entry_view_constructor;
+ object_class->constructed = rb_entry_view_constructed;
object_class->set_property = rb_entry_view_set_property;
object_class->get_property = rb_entry_view_get_property;
@@ -1784,17 +1783,14 @@ rb_entry_view_set_columns_clickable (RBEntryView *view,
g_list_free (columns);
}
-static GObject *
-rb_entry_view_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_entry_view_constructed (GObject *object)
{
RBEntryView *view;
- RBEntryViewClass *klass;
- klass = RB_ENTRY_VIEW_CLASS (g_type_class_peek (RB_TYPE_ENTRY_VIEW));
- view = RB_ENTRY_VIEW (G_OBJECT_CLASS (rb_entry_view_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_entry_view_parent_class, constructed, object);
+
+ view = RB_ENTRY_VIEW (object);
view->priv->treeview = GTK_WIDGET (gtk_tree_view_new ());
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (view->priv->treeview), TRUE);
@@ -1892,8 +1888,6 @@ rb_entry_view_constructor (GType type,
rb_entry_view_set_model (view, RHYTHMDB_QUERY_MODEL (query_model));
g_object_unref (query_model);
}
-
- return G_OBJECT (view);
}
static void
diff --git a/widgets/rb-library-browser.c b/widgets/rb-library-browser.c
index 9d6eab1..2e84c7a 100644
--- a/widgets/rb-library-browser.c
+++ b/widgets/rb-library-browser.c
@@ -50,8 +50,7 @@ static void rb_library_browser_class_init (RBLibraryBrowserClass *klass);
static void rb_library_browser_init (RBLibraryBrowser *entry);
static void rb_library_browser_finalize (GObject *object);
static void rb_library_browser_dispose (GObject *object);
-static GObject* rb_library_browser_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_library_browser_constructed (GObject *object);
static void rb_library_browser_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -152,7 +151,7 @@ rb_library_browser_class_init (RBLibraryBrowserClass *klass)
object_class->finalize = rb_library_browser_finalize;
object_class->dispose = rb_library_browser_dispose;
- object_class->constructor = rb_library_browser_constructor;
+ object_class->constructed = rb_library_browser_constructed;
object_class->set_property = rb_library_browser_set_property;
object_class->get_property = rb_library_browser_get_property;
@@ -229,20 +228,16 @@ rb_library_browser_init (RBLibraryBrowser *widget)
priv->selections = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)rb_list_deep_free);
}
-static GObject *
-rb_library_browser_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_library_browser_constructed (GObject *object)
{
- RBLibraryBrowserClass *klass;
RBLibraryBrowser *browser;
RBLibraryBrowserPrivate *priv;
int i;
- klass = RB_LIBRARY_BROWSER_CLASS (g_type_class_peek (RB_TYPE_LIBRARY_BROWSER));
+ RB_CHAIN_GOBJECT_METHOD (rb_library_browser_parent_class, constructed, object);
- browser = RB_LIBRARY_BROWSER (G_OBJECT_CLASS (rb_library_browser_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ browser = RB_LIBRARY_BROWSER (object);
priv = RB_LIBRARY_BROWSER_GET_PRIVATE (browser);
for (i = 0; i < num_browser_properties; i++) {
@@ -271,8 +266,6 @@ rb_library_browser_constructor (GType type,
priv->browser_view_notify_id =
eel_gconf_notification_add (CONF_UI_BROWSER_VIEWS,
(GConfClientNotifyFunc) rb_library_browser_views_changed, browser);
-
- return G_OBJECT (browser);
}
static void
diff --git a/widgets/rb-property-view.c b/widgets/rb-property-view.c
index 9916055..5a7dd2c 100644
--- a/widgets/rb-property-view.c
+++ b/widgets/rb-property-view.c
@@ -58,8 +58,7 @@ static void rb_property_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static GObject * rb_property_view_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_property_view_constructed (GObject *object);
static void rb_property_view_row_activated_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
@@ -141,7 +140,7 @@ rb_property_view_class_init (RBPropertyViewClass *klass)
object_class->dispose = rb_property_view_dispose;
object_class->finalize = rb_property_view_finalize;
- object_class->constructor = rb_property_view_constructor;
+ object_class->constructed = rb_property_view_constructed;
object_class->set_property = rb_property_view_set_property;
object_class->get_property = rb_property_view_get_property;
@@ -652,21 +651,16 @@ rb_property_view_cell_data_func (GtkTreeViewColumn *column,
g_free (title);
}
-static GObject *
-rb_property_view_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_property_view_constructed (GObject *object)
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
-
RBPropertyView *view;
- RBPropertyViewClass *klass;
- klass = RB_PROPERTY_VIEW_CLASS (g_type_class_peek (RB_TYPE_PROPERTY_VIEW));
+ RB_CHAIN_GOBJECT_METHOD (rb_property_view_parent_class, constructed, object);
- view = RB_PROPERTY_VIEW (G_OBJECT_CLASS (rb_property_view_parent_class)->
- constructor (type, n_construct_properties, construct_properties));
+ view = RB_PROPERTY_VIEW (object);
view->priv->prop_model = rhythmdb_property_model_new (view->priv->db, view->priv->propid);
view->priv->treeview = GTK_WIDGET (gtk_tree_view_new_with_model (GTK_TREE_MODEL (view->priv->prop_model)));
@@ -714,8 +708,6 @@ rb_property_view_constructor (GType type,
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_append_column (GTK_TREE_VIEW (view->priv->treeview),
column);
-
- return G_OBJECT (view);
}
static void
diff --git a/widgets/rb-query-creator.c b/widgets/rb-query-creator.c
index 4865658..d7ddc68 100644
--- a/widgets/rb-query-creator.c
+++ b/widgets/rb-query-creator.c
@@ -45,8 +45,7 @@
#include "rb-util.h"
static void rb_query_creator_class_init (RBQueryCreatorClass *klass);
-static GObject *rb_query_creator_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_query_creator_constructed (GObject *object);
static void rb_query_creator_dispose (GObject *object);
static void rb_query_creator_set_property (GObject *object,
guint prop_id,
@@ -137,7 +136,7 @@ rb_query_creator_class_init (RBQueryCreatorClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = rb_query_creator_dispose;
- object_class->constructor = rb_query_creator_constructor;
+ object_class->constructed = rb_query_creator_constructed;
object_class->set_property = rb_query_creator_set_property;
object_class->get_property = rb_query_creator_get_property;
@@ -176,18 +175,17 @@ rb_query_creator_init (RBQueryCreator *creator)
}
-static GObject *
-rb_query_creator_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_query_creator_constructed (GObject *object)
{
RBQueryCreatorPrivate *priv;
RBQueryCreator *creator;
GtkWidget *mainbox;
GtkBuilder *builder;
- creator = RB_QUERY_CREATOR (G_OBJECT_CLASS (rb_query_creator_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ RB_CHAIN_GOBJECT_METHOD (rb_query_creator_parent_class, dispose, object);
+
+ creator = RB_QUERY_CREATOR (object);
priv = QUERY_CREATOR_GET_PRIVATE (creator);
if (priv->creating) {
@@ -251,8 +249,6 @@ rb_query_creator_constructor (GType type,
gtk_widget_show_all (GTK_WIDGET (creator));
g_object_unref (builder);
-
- return G_OBJECT (creator);
}
static void
diff --git a/widgets/rb-song-info.c b/widgets/rb-song-info.c
index cdc2148..02a4aba 100644
--- a/widgets/rb-song-info.c
+++ b/widgets/rb-song-info.c
@@ -56,11 +56,11 @@
#include "rb-source.h"
#include "rb-shell.h"
#include "rb-file-helpers.h"
+#include "rb-util.h"
static void rb_song_info_class_init (RBSongInfoClass *klass);
static void rb_song_info_init (RBSongInfo *song_info);
-static GObject *rb_song_info_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties);
+static void rb_song_info_constructed (GObject *object);
static void rb_song_info_show (GtkWidget *widget);
static void rb_song_info_dispose (GObject *object);
@@ -209,7 +209,7 @@ rb_song_info_class_init (RBSongInfoClass *klass)
object_class->set_property = rb_song_info_set_property;
object_class->get_property = rb_song_info_get_property;
- object_class->constructor = rb_song_info_constructor;
+ object_class->constructed = rb_song_info_constructed;
widget_class->show = rb_song_info_show;
@@ -432,12 +432,10 @@ rb_song_info_add_completion (GtkEntry *entry, RhythmDBPropertyModel *propmodel)
g_object_unref (completion);
}
-static GObject *
-rb_song_info_constructor (GType type, guint n_construct_properties,
- GObjectConstructParam *construct_properties)
+static void
+rb_song_info_constructed (GObject *object)
{
RBSongInfo *song_info;
- RBSongInfoClass *klass;
GList *selected_entries;
GList *tem;
gboolean editable = TRUE;
@@ -445,14 +443,13 @@ rb_song_info_constructor (GType type, guint n_construct_properties,
AtkObject *lobj, *robj;
GtkBuilder *builder;
- klass = RB_SONG_INFO_CLASS (g_type_class_peek (RB_TYPE_SONG_INFO));
+ RB_CHAIN_GOBJECT_METHOD (rb_song_info_parent_class, constructed, object);
- song_info = RB_SONG_INFO (G_OBJECT_CLASS (rb_song_info_parent_class)
- ->constructor (type, n_construct_properties, construct_properties));
+ song_info = RB_SONG_INFO (object);
selected_entries = rb_entry_view_get_selected_entries (song_info->priv->entry_view);
- g_return_val_if_fail (selected_entries != NULL, NULL);
+ g_return_if_fail (selected_entries != NULL);
for (tem = selected_entries; tem; tem = tem->next) {
if (!rhythmdb_entry_is_editable (song_info->priv->db,
@@ -567,8 +564,6 @@ rb_song_info_constructor (GType type, guint n_construct_properties,
GTK_RESPONSE_CLOSE);
g_object_unref (builder);
-
- return G_OBJECT (song_info);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]