[rhythmbox] fix various impl_get_status methods to not return progress 0.0



commit 2cda84a4844ce29d157d2c3532b39f272804fe2e
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Jun 7 22:44:44 2010 +1000

    fix various impl_get_status methods to not return progress 0.0
    
    The annoying bit here is that Python implementations don't have a way to
    decline to return a progress value, so for Magnatune and Jamendo we
    return 2.0 (anything greater than 1.0 means 'hide the progress bar')
    unless we have a specific value to return.  This means we lose the
    progress value from rhythmdb for these sources, unfortunately.

 plugins/daap/rb-daap-source.c                  |   10 ----------
 plugins/jamendo/jamendo/JamendoSource.py       |    2 +-
 plugins/magnatune/magnatune/MagnatuneSource.py |    2 +-
 sources/rb-streaming-source.c                  |    2 +-
 4 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/plugins/daap/rb-daap-source.c b/plugins/daap/rb-daap-source.c
index 9ec42af..6a07369 100644
--- a/plugins/daap/rb-daap-source.c
+++ b/plugins/daap/rb-daap-source.c
@@ -765,16 +765,6 @@ rb_daap_source_get_status (RBSource *source,
 {
 	RBDAAPSource *daap_source = RB_DAAP_SOURCE (source);
 
-	if (text != NULL) {
-		*text = NULL;
-	}
-	if (progress_text != NULL) {
-		*progress_text = NULL;
-	}
-	if (progress != NULL) {
-		*progress = 1.0;
-	}
-
 	if (daap_source->priv->connection_status != NULL) {
 		if (text != NULL) {
 			*text = g_strdup (daap_source->priv->connection_status);
diff --git a/plugins/jamendo/jamendo/JamendoSource.py b/plugins/jamendo/jamendo/JamendoSource.py
index d8f70a7..007063d 100644
--- a/plugins/jamendo/jamendo/JamendoSource.py
+++ b/plugins/jamendo/jamendo/JamendoSource.py
@@ -123,7 +123,7 @@ class JamendoSource(rb.BrowserSource):
 			return (_("Loading Jamendo catalog"), None, progress)
 		else:
 			qm = self.get_property("query-model")
-			return (qm.compute_status_normal("%d song", "%d songs"), None, 0.0)
+			return (qm.compute_status_normal("%d song", "%d songs"), None, 2.0)
 
 	def do_impl_activate(self):
 		if not self.__activated:
diff --git a/plugins/magnatune/magnatune/MagnatuneSource.py b/plugins/magnatune/magnatune/MagnatuneSource.py
index eeecb33..00dbbff 100644
--- a/plugins/magnatune/magnatune/MagnatuneSource.py
+++ b/plugins/magnatune/magnatune/MagnatuneSource.py
@@ -120,7 +120,7 @@ class MagnatuneSource(rb.BrowserSource):
 			return (_("Downloading Magnatune Album(s)"), None, progress)
 		else:
 			qm = self.get_property("query-model")
-			return (qm.compute_status_normal("%d song", "%d songs"), None, 0.0)
+			return (qm.compute_status_normal("%d song", "%d songs"), None, 2.0)
 
 	def do_impl_get_ui_actions(self):
 		return ["MagnatuneDownloadAlbum",
diff --git a/sources/rb-streaming-source.c b/sources/rb-streaming-source.c
index 4bb8d6e..5e13e33 100644
--- a/sources/rb-streaming-source.c
+++ b/sources/rb-streaming-source.c
@@ -212,8 +212,8 @@ impl_handle_eos (RBSource *asource)
 void
 rb_streaming_source_get_progress (RBStreamingSource *source, char **text, float *progress)
 {
-	*progress = 0.0;
 	if (source->priv->buffering == -1) {
+		*progress = 0.0;
 		g_free (*text);
 		*text = g_strdup (_("Connecting"));
 	} else if (source->priv->buffering > 0) {



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