[tracker/class-signal: 32/50] tracker-writeback: Fixes after Martyn's review



commit 3f833287d091acbb47317614fde8d4f8f56bdf07
Author: Philip Van Hoof <philip codeminded be>
Date:   Mon Aug 23 18:16:27 2010 +0200

    tracker-writeback: Fixes after Martyn's review

 src/tracker-writeback/tracker-writeback-consumer.c |   15 +++++++--------
 src/tracker-writeback/tracker-writeback-playlist.c |    2 +-
 src/tracker-writeback/tracker-writeback-taglib.c   |    6 +++++-
 3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-consumer.c b/src/tracker-writeback/tracker-writeback-consumer.c
index 564e3bd..7dfde54 100644
--- a/src/tracker-writeback/tracker-writeback-consumer.c
+++ b/src/tracker-writeback/tracker-writeback-consumer.c
@@ -228,12 +228,8 @@ sparql_query_cb (GObject      *object,
 		}
 		g_ptr_array_free (results, TRUE);
 	} else {
-		if (error != NULL) {
-			g_message ("  No files qualify for updates (%s)", error->message);
-			g_error_free (error);
-		} else {
-			g_message ("  No files qualify for updates");
-		}
+		g_message ("  No files qualify for updates (%s)", error->message);
+		g_error_free (error);
 	}
 
 	g_object_unref (cursor);
@@ -271,8 +267,11 @@ process_queue_cb (gpointer user_data)
 	                         "}",
 	                         data->subject, data->subject);
 
-	tracker_sparql_connection_query_async (priv->connection, query, NULL,
-	                                       sparql_query_cb, consumer);
+	tracker_sparql_connection_query_async (priv->connection,
+	                                       query,
+	                                       NULL,
+	                                       sparql_query_cb,
+	                                       consumer);
 
 	g_free (query);
 
diff --git a/src/tracker-writeback/tracker-writeback-playlist.c b/src/tracker-writeback/tracker-writeback-playlist.c
index 5116caa..adca1f4 100644
--- a/src/tracker-writeback/tracker-writeback-playlist.c
+++ b/src/tracker-writeback/tracker-writeback-playlist.c
@@ -173,7 +173,7 @@ rewrite_playlist (TrackerSparqlConnection *connection,
 			totem_pl_playlist_append  (playlist, &iter);
 			totem_pl_playlist_set (playlist, &iter,
 			                       TOTEM_PL_PARSER_FIELD_URI,
-			                       tracker_sparql_cursor_get_string (cursor, 0),
+			                       tracker_sparql_cursor_get_string (cursor, 0, NULL),
 			                       NULL);
 			amount++;
 		}
diff --git a/src/tracker-writeback/tracker-writeback-taglib.c b/src/tracker-writeback/tracker-writeback-taglib.c
index 881d32b..57b2bbe 100644
--- a/src/tracker-writeback/tracker-writeback-taglib.c
+++ b/src/tracker-writeback/tracker-writeback-taglib.c
@@ -218,7 +218,7 @@ writeback_taglib_get_from_query (TrackerSparqlConnection *connection,
 	                                          NULL,
 	                                          &error);
 
-	if (error || !tracker_sparql_cursor_next (cursor, NULL, NULL)) {
+	if (error || !cursor || !tracker_sparql_cursor_next (cursor, NULL, NULL)) {
 		g_warning ("Couldn't find %s for artist with urn '%s', %s",
 		           errmsg,
 		           urn,
@@ -242,10 +242,12 @@ writeback_taglib_get_artist_name (TrackerSparqlConnection *connection,
                                   const gchar             *urn)
 {
 	gchar *val, *query;
+
 	query = g_strdup_printf ("SELECT ?artistName WHERE {<%s> nmm:artistName ?artistName}",
 	                         urn);
 	val = writeback_taglib_get_from_query (connection, urn, query, "artist name");
 	g_free (query);
+
 	return val;
 }
 
@@ -254,10 +256,12 @@ writeback_taglib_get_album_name (TrackerSparqlConnection *connection,
                                  const gchar             *urn)
 {
 	gchar *val, *query;
+
 	query = g_strdup_printf ("SELECT ?albumName WHERE {<%s> dc:title ?albumName}",
 	                         urn);
 	val = writeback_taglib_get_from_query (connection, urn, query, "album name");
 	g_free (query);
+
 	return val;
 }
 



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