[rhythmbox] [ipod] use itdb_start_sync and itdb_stop_sync



commit b9da7401477e7f1373d8899796947ad5c66122ca
Author: Christophe Fergeau <teuf gnome org>
Date:   Tue Mar 23 17:33:52 2010 +0100

    [ipod] use itdb_start_sync and itdb_stop_sync
    
    When available, these functions show/hide the "sync in progress" screen on
    iPhone-like devices so that the user knows he shouldn't unplug his device

 configure.ac              |    5 +++++
 plugins/ipod/rb-ipod-db.c |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 76ebc48..c4fc709 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,6 +163,11 @@ if test "x$with_ipod" != "xno"; then
 	  AC_MSG_ERROR([iPod explicitly requested but libgpod couldn't be found])
 	fi
 	if test "x$have_libgpod" = "xyes"; then
+	  PKG_CHECK_EXISTS(libgpod-1.0 >= 0.7.92, have_itdb_start_stop_sync=yes,
+						  have_itdb_start_stop_sync=no)
+          if test "x$have_itdb_start_stop_sync" = "xyes"; then
+	    AC_DEFINE([HAVE_ITDB_START_STOP_SYNC], 1, [Indicates whether libgpod is new enough to have its itdb_start/stop_sync API])
+          fi
 	  use_ipod=yes
 	  AC_SUBST(IPOD_CFLAGS)
 	  AC_SUBST(IPOD_LIBS)
diff --git a/plugins/ipod/rb-ipod-db.c b/plugins/ipod/rb-ipod-db.c
index fe44ce5..83df41d 100644
--- a/plugins/ipod/rb-ipod-db.c
+++ b/plugins/ipod/rb-ipod-db.c
@@ -133,6 +133,9 @@ rb_itdb_save (RbIpodDb *ipod_db, GError **error)
 	if (priv->needs_shuffle_db) {
 		itdb_shuffle_write (priv->itdb, error);
 	}
+#ifdef HAVE_ITDB_START_STOP_SYNC
+	itdb_stop_sync (priv->itdb);
+#endif
 }
 
 static void
@@ -859,7 +862,9 @@ rb_ipod_db_save_async (RbIpodDb *ipod_db)
 	RbIpodDbPrivate *priv = IPOD_DB_GET_PRIVATE (ipod_db);
 
 	if (priv->save_timeout_id == 0) {
-		RbIpodDbPrivate *priv = IPOD_DB_GET_PRIVATE (ipod_db);
+#ifdef HAVE_ITDB_START_STOP_SYNC
+		itdb_start_sync (priv->itdb);
+#endif
 		rb_debug ("Scheduling iPod database save in 2 seconds");
 	} else {
 		g_source_remove (priv->save_timeout_id);



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