[rhythmbox] audioscrobbler: remove priv field from RBAudioscrobblerPlugin.



commit 2cb2c7883cc098292207613beaa11f70ea72adbf
Author: Jamie Nicol <jamie thenicols net>
Date:   Sat May 29 13:04:53 2010 +0100

    audioscrobbler: remove priv field from RBAudioscrobblerPlugin.
    
    Not necessary as it is declared within implementation file

 plugins/audioscrobbler/rb-audioscrobbler-plugin.c |   53 ++++++++------------
 1 files changed, 21 insertions(+), 32 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-plugin.c b/plugins/audioscrobbler/rb-audioscrobbler-plugin.c
index 95f8654..4f83722 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-plugin.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-plugin.c
@@ -53,15 +53,10 @@
 
 typedef struct
 {
-	RBAudioscrobblerAccount *account;
-	GtkWidget *preferences;
-} RBAudioscrobblerPluginPrivate;
-
-typedef struct
-{
 	RBPlugin parent;
 
-	RBAudioscrobblerPluginPrivate *priv;
+	RBAudioscrobblerAccount *account;
+	GtkWidget *preferences;
 } RBAudioscrobblerPlugin;
 
 typedef struct
@@ -69,8 +64,6 @@ typedef struct
 	RBPluginClass parent_class;
 } RBAudioscrobblerPluginClass;
 
-#define RB_AUDIOSCROBBLER_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_AUDIOSCROBBLER_PLUGIN, RBAudioscrobblerPluginPrivate))
-
 G_MODULE_EXPORT GType register_rb_plugin (GTypeModule *module);
 GType	rb_audioscrobbler_plugin_get_type		(void) G_GNUC_CONST;
 
@@ -95,16 +88,12 @@ rb_audioscrobbler_plugin_class_init (RBAudioscrobblerPluginClass *klass)
 	plugin_class->activate = impl_activate;
 	plugin_class->deactivate = impl_deactivate;
 	plugin_class->create_configure_dialog = impl_create_configure_dialog;
-
-	g_type_class_add_private (klass, sizeof (RBAudioscrobblerPluginPrivate));
 }
 
 static void
 rb_audioscrobbler_plugin_init (RBAudioscrobblerPlugin *plugin)
 {
 	rb_debug ("RBAudioscrobblerPlugin initialising");
-
-	plugin->priv = RB_AUDIOSCROBBLER_PLUGIN_GET_PRIVATE (plugin);
 }
 
 static void
@@ -114,10 +103,10 @@ rb_audioscrobbler_plugin_finalize (GObject *object)
 
 	rb_debug ("RBAudioscrobblerPlugin finalising");
 
-	g_assert (plugin->priv->account == NULL);
+	g_assert (plugin->account == NULL);
 
-	if (plugin->priv->preferences)
-		gtk_widget_destroy (plugin->priv->preferences);
+	if (plugin->preferences)
+		gtk_widget_destroy (plugin->preferences);
 
 	G_OBJECT_CLASS (rb_audioscrobbler_plugin_parent_class)->finalize (object);
 }
@@ -130,8 +119,8 @@ impl_activate (RBPlugin *bplugin,
 {
 	RBAudioscrobblerPlugin *plugin = RB_AUDIOSCROBBLER_PLUGIN (bplugin);
 
-	g_assert (plugin->priv->account == NULL);
-	plugin->priv->account = rb_audioscrobbler_account_new (shell);
+	g_assert (plugin->account == NULL);
+	plugin->account = rb_audioscrobbler_account_new (shell);
 }
 
 static void
@@ -140,8 +129,8 @@ impl_deactivate	(RBPlugin *bplugin,
 {
 	RBAudioscrobblerPlugin *plugin = RB_AUDIOSCROBBLER_PLUGIN (bplugin);
 
-	g_object_unref (plugin->priv->account);
-	plugin->priv->account = NULL;
+	g_object_unref (plugin->account);
+	plugin->account = NULL;
 }
 
 static void
@@ -154,34 +143,34 @@ static GtkWidget*
 impl_create_configure_dialog (RBPlugin *bplugin)
 {
 	RBAudioscrobblerPlugin *plugin = RB_AUDIOSCROBBLER_PLUGIN (bplugin);
-	if (plugin->priv->account == NULL)
+	if (plugin->account == NULL)
 		return NULL;
 
-	if (plugin->priv->preferences == NULL) {
+	if (plugin->preferences == NULL) {
 		GtkWidget *widget;
 
-		widget = rb_audioscrobbler_account_get_config_widget (plugin->priv->account, bplugin);
+		widget = rb_audioscrobbler_account_get_config_widget (plugin->account, bplugin);
 
-		plugin->priv->preferences = gtk_dialog_new_with_buttons (_("Last.fm Preferences"),
+		plugin->preferences = gtk_dialog_new_with_buttons (_("Last.fm Preferences"),
 		                                                         NULL,
 		                                                         GTK_DIALOG_DESTROY_WITH_PARENT,
 		                                                         GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
 		                                                         NULL);
-                gtk_dialog_set_has_separator (GTK_DIALOG (plugin->priv->preferences), FALSE);
-                gtk_container_set_border_width (GTK_CONTAINER (plugin->priv->preferences), 5);
-                gtk_window_set_resizable (GTK_WINDOW (plugin->priv->preferences), FALSE);
+                gtk_dialog_set_has_separator (GTK_DIALOG (plugin->preferences), FALSE);
+                gtk_container_set_border_width (GTK_CONTAINER (plugin->preferences), 5);
+                gtk_window_set_resizable (GTK_WINDOW (plugin->preferences), FALSE);
 
-		g_signal_connect (G_OBJECT (plugin->priv->preferences),
+		g_signal_connect (G_OBJECT (plugin->preferences),
 				  "response",
 				  G_CALLBACK (preferences_response_cb),
 				  plugin);
-		gtk_widget_hide_on_delete (plugin->priv->preferences);
+		gtk_widget_hide_on_delete (plugin->preferences);
 
-		gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (plugin->priv->preferences))),
+		gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (plugin->preferences))),
 				   widget);
 	}
 
-	gtk_widget_show_all (plugin->priv->preferences);
-	return plugin->priv->preferences;
+	gtk_widget_show_all (plugin->preferences);
+	return plugin->preferences;
 }
 



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