rhythmbox r5734 - in trunk: . plugins/audioscrobbler



Author: jmatthew
Date: Mon Jun  9 11:27:14 2008
New Revision: 5734
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5734&view=rev

Log:
2008-06-09  Jonathan Matthew  <jonathan d14n org>

	* plugins/audioscrobbler/rb-audioscrobbler.c:
	(rb_audioscrobbler_gconf_changed_cb):
	Check if the username/password actually changes, and if it has, reset
	the handshake timer as well as forgetting if we have a handshake.
	Fixes #499745 I guess.


Modified:
   trunk/ChangeLog
   trunk/plugins/audioscrobbler/rb-audioscrobbler.c

Modified: trunk/plugins/audioscrobbler/rb-audioscrobbler.c
==============================================================================
--- trunk/plugins/audioscrobbler/rb-audioscrobbler.c	(original)
+++ trunk/plugins/audioscrobbler/rb-audioscrobbler.c	Mon Jun  9 11:27:14 2008
@@ -61,6 +61,7 @@
 #include "rb-proxy-config.h"
 #include "rb-cut-and-paste-code.h"
 #include "rb-plugin.h"
+#include "rb-util.h"
 
 #include "rb-audioscrobbler-entry.h"
 
@@ -1264,12 +1265,17 @@
 {
 	rb_debug ("GConf key updated: \"%s\"", entry->key);
 	if (strcmp (entry->key, CONF_AUDIOSCROBBLER_USERNAME) == 0) {
-		const gchar *username;
+		const char *username;
+
+		username = gconf_value_get_string (entry->value);
+		if (rb_safe_strcmp (username, audioscrobbler->priv->username) == 0) {
+			rb_debug ("username not modified");
+			return;
+		}
 
 		g_free (audioscrobbler->priv->username);
 		audioscrobbler->priv->username = NULL;
 
-		username = gconf_value_get_string (entry->value);
 		if (username != NULL) {
 			audioscrobbler->priv->username = g_strdup (username);
 		}
@@ -1281,13 +1287,19 @@
 		}
 
 		audioscrobbler->priv->handshake = FALSE;
+		audioscrobbler->priv->handshake_next = 0;
 	} else if (strcmp (entry->key, CONF_AUDIOSCROBBLER_PASSWORD) == 0) {
-		const gchar *password;
+		const char *password;
+
+		password = gconf_value_get_string (entry->value);
+		if (rb_safe_strcmp (password, audioscrobbler->priv->password) == 0) {
+			rb_debug ("password not modified");
+			return;
+		}
 
 		g_free (audioscrobbler->priv->password);
 		audioscrobbler->priv->password = NULL;
 
-		password = gconf_value_get_string (entry->value);
 		if (password != NULL) {
 			audioscrobbler->priv->password = g_strdup (password);
 		}
@@ -1297,6 +1309,9 @@
 			gtk_entry_set_text (GTK_ENTRY (audioscrobbler->priv->password_entry),
 					    v ? v : "");
 		}
+
+		audioscrobbler->priv->handshake = FALSE;
+		audioscrobbler->priv->handshake_next = 0;
 	} else {
 		rb_debug ("Unhandled GConf key updated: \"%s\"", entry->key);
 	}



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