[rhythmbox] mtp: use an idle handler for UI changes on track list load



commit abcc969765400450ebc3ce649a4ea93ccc4dee6b
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Sep 15 00:34:54 2012 +1000

    mtp: use an idle handler for UI changes on track list load

 plugins/mtpdevice/rb-mtp-source.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index abe7281..8134d09 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -983,6 +983,14 @@ mtp_device_open_cb (LIBMTP_mtpdevice_t *device, RBMtpSource *source)
 	rb_mtp_thread_get_track_list (priv->device_thread, (RBMtpTrackListCallback) mtp_tracklist_cb, g_object_ref (source), g_object_unref);
 }
 
+static gboolean
+device_loaded_idle (RBMtpSource *source)
+{
+	g_object_set (source, "load-status", RB_SOURCE_LOAD_STATUS_LOADED, NULL);
+	rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), NULL, FALSE);
+	return FALSE;
+}
+
 static void
 mtp_tracklist_cb (LIBMTP_track_t *tracks, RBMtpSource *source)
 {
@@ -996,9 +1004,7 @@ mtp_tracklist_cb (LIBMTP_track_t *tracks, RBMtpSource *source)
 	}
 	g_object_unref (db);
 
-	g_object_set (source, "load-status", RB_SOURCE_LOAD_STATUS_LOADED, NULL);
-
-	rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), NULL, FALSE);
+	g_idle_add ((GSourceFunc) device_loaded_idle, source);
 }
 
 static char *



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