[tracker/writeback] Fixes addressing Martyn's review
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/writeback] Fixes addressing Martyn's review
- Date: Tue, 22 Dec 2009 15:14:46 +0000 (UTC)
commit d031bff0ade3b85617f64f3d8979e245921da9ce
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Dec 22 16:13:06 2009 +0100
Fixes addressing Martyn's review
src/tracker-writeback/tracker-writeback-xmp.c | 153 ++++++++++++-------------
1 files changed, 71 insertions(+), 82 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-xmp.c b/src/tracker-writeback/tracker-writeback-xmp.c
index 300d2e5..50bdd12 100644
--- a/src/tracker-writeback/tracker-writeback-xmp.c
+++ b/src/tracker-writeback/tracker-writeback-xmp.c
@@ -163,26 +163,23 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
g_free (query);
- if (!error) {
- if (name_array && name_array->len > 0) {
- GStrv name_row;
+ if (name_array && name_array->len > 0) {
+ GStrv name_row;
- name_row = g_ptr_array_index (name_array, 0);
+ name_row = g_ptr_array_index (name_array, 0);
- if (name_row[0]) {
- xmp_delete_property (xmp, NS_DC, "creator");
- xmp_set_property (xmp, NS_DC, "creator", name_row[0], 0);
- }
- }
-
- if (name_array) {
- g_ptr_array_foreach (name_array, (GFunc) g_strfreev, NULL);
- g_ptr_array_free (name_array, TRUE);
+ if (name_row[0]) {
+ xmp_delete_property (xmp, NS_DC, "creator");
+ xmp_set_property (xmp, NS_DC, "creator", name_row[0], 0);
}
+ }
- } else {
- g_clear_error (&error);
+ if (name_array) {
+ g_ptr_array_foreach (name_array, (GFunc) g_strfreev, NULL);
+ g_ptr_array_free (name_array, TRUE);
}
+
+ g_clear_error (&error);
}
if (g_strcmp0 (row[1], TRACKER_NCO_PREFIX "contributor") == 0) {
@@ -198,26 +195,23 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
g_free (query);
- if (!error) {
- if (name_array && name_array->len > 0) {
- GStrv name_row;
+ if (name_array && name_array->len > 0) {
+ GStrv name_row;
- name_row = g_ptr_array_index (name_array, 0);
+ name_row = g_ptr_array_index (name_array, 0);
- if (name_row[0]) {
- xmp_delete_property (xmp, NS_DC, "contributor");
- xmp_set_property (xmp, NS_DC, "contributor", name_row[0], 0);
- }
- }
-
- if (name_array) {
- g_ptr_array_foreach (name_array, (GFunc) g_strfreev, NULL);
- g_ptr_array_free (name_array, TRUE);
+ if (name_row[0]) {
+ xmp_delete_property (xmp, NS_DC, "contributor");
+ xmp_set_property (xmp, NS_DC, "contributor", name_row[0], 0);
}
+ }
- } else {
- g_clear_error (&error);
+ if (name_array) {
+ g_ptr_array_foreach (name_array, (GFunc) g_strfreev, NULL);
+ g_ptr_array_free (name_array, TRUE);
}
+
+ g_clear_error (&error);
}
if (g_strcmp0 (row[1], TRACKER_NIE_PREFIX "description") == 0) {
@@ -368,7 +362,7 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
g_free (work_on);
}
- if (g_strcmp0 (row[1], TRACKER_MLO_PREFIX "location") == 0 ||
+ if (g_strcmp0 (row[1], TRACKER_MLO_PREFIX "location") == 0 ||
g_strcmp0 (row[1], TRACKER_MLO_PREFIX "city") == 0 ||
g_strcmp0 (row[1], TRACKER_MLO_PREFIX "country") == 0 ||
g_strcmp0 (row[1], TRACKER_MLO_PREFIX "state") == 0 ||
@@ -390,63 +384,58 @@ writeback_xmp_update_file_metadata (TrackerWritebackFile *wbf,
g_free (query);
- if (!error) {
- if (array && array->len > 0) {
- GStrv qrow;
-
- qrow = g_ptr_array_index (array, 0);
-
- /* TODO: A lot of these location fields are pretty vague and ambigious.
- * We should go through them one by one and ensure that all of them are
- * used sanely */
-
- if (!tracker_is_empty_string (qrow[0])) {
- xmp_delete_property (xmp, NS_IPTC4XMP, "City");
- xmp_set_property (xmp, NS_IPTC4XMP, "City", qrow[0], 0);
- xmp_delete_property (xmp, NS_PHOTOSHOP, "City");
- xmp_set_property (xmp, NS_PHOTOSHOP, "City", qrow[0], 0);
- }
- g_free (qrow[0]);
-
- if (!tracker_is_empty_string (qrow[1])) {
- xmp_delete_property (xmp, NS_IPTC4XMP, "State");
- xmp_set_property (xmp, NS_IPTC4XMP, "State", qrow[1], 0);
- xmp_delete_property (xmp, NS_IPTC4XMP, "Province");
- xmp_set_property (xmp, NS_IPTC4XMP, "Province", qrow[1], 0);
- xmp_delete_property (xmp, NS_PHOTOSHOP, "State");
- xmp_set_property (xmp, NS_PHOTOSHOP, "State", qrow[1], 0);
- }
- g_free (qrow[1]);
-
- if (!tracker_is_empty_string (qrow[2])) {
- xmp_delete_property (xmp, NS_IPTC4XMP, "SubLocation");
- xmp_set_property (xmp, NS_IPTC4XMP, "SubLocation", qrow[2], 0);
- xmp_delete_property (xmp, NS_PHOTOSHOP, "Location");
- xmp_set_property (xmp, NS_PHOTOSHOP, "Location", qrow[2], 0);
- }
- g_free (qrow[2]);
-
- if (!tracker_is_empty_string (qrow[3])) {
- xmp_delete_property (xmp, NS_PHOTOSHOP, "Country");
- xmp_set_property (xmp, NS_PHOTOSHOP, "Country", qrow[3], 0);
- xmp_delete_property (xmp, NS_IPTC4XMP, "Country");
- xmp_set_property (xmp, NS_IPTC4XMP, "Country", qrow[3], 0);
- xmp_delete_property (xmp, NS_IPTC4XMP, "PrimaryLocationName");
- xmp_set_property (xmp, NS_IPTC4XMP, "PrimaryLocationName", qrow[3], 0);
- }
- g_free (qrow[3]);
+ if (array && array->len > 0) {
+ GStrv qrow;
+
+ qrow = g_ptr_array_index (array, 0);
+
+ /* TODO: A lot of these location fields are pretty vague and ambigious.
+ * We should go through them one by one and ensure that all of them are
+ * used sanely */
+ if (!tracker_is_blank_string (qrow[0])) {
+ xmp_delete_property (xmp, NS_IPTC4XMP, "City");
+ xmp_set_property (xmp, NS_IPTC4XMP, "City", qrow[0], 0);
+ xmp_delete_property (xmp, NS_PHOTOSHOP, "City");
+ xmp_set_property (xmp, NS_PHOTOSHOP, "City", qrow[0], 0);
}
+ g_free (qrow[0]);
+
+ if (!tracker_is_blank_string (qrow[1])) {
+ xmp_delete_property (xmp, NS_IPTC4XMP, "State");
+ xmp_set_property (xmp, NS_IPTC4XMP, "State", qrow[1], 0);
+ xmp_delete_property (xmp, NS_IPTC4XMP, "Province");
+ xmp_set_property (xmp, NS_IPTC4XMP, "Province", qrow[1], 0);
+ xmp_delete_property (xmp, NS_PHOTOSHOP, "State");
+ xmp_set_property (xmp, NS_PHOTOSHOP, "State", qrow[1], 0);
+ }
+ g_free (qrow[1]);
- if (array) {
- g_ptr_array_free (array, TRUE);
+ if (!tracker_is_blank_string (qrow[2])) {
+ xmp_delete_property (xmp, NS_IPTC4XMP, "SubLocation");
+ xmp_set_property (xmp, NS_IPTC4XMP, "SubLocation", qrow[2], 0);
+ xmp_delete_property (xmp, NS_PHOTOSHOP, "Location");
+ xmp_set_property (xmp, NS_PHOTOSHOP, "Location", qrow[2], 0);
+ }
+ g_free (qrow[2]);
+
+ if (!tracker_is_blank_string (qrow[3])) {
+ xmp_delete_property (xmp, NS_PHOTOSHOP, "Country");
+ xmp_set_property (xmp, NS_PHOTOSHOP, "Country", qrow[3], 0);
+ xmp_delete_property (xmp, NS_IPTC4XMP, "Country");
+ xmp_set_property (xmp, NS_IPTC4XMP, "Country", qrow[3], 0);
+ xmp_delete_property (xmp, NS_IPTC4XMP, "PrimaryLocationName");
+ xmp_set_property (xmp, NS_IPTC4XMP, "PrimaryLocationName", qrow[3], 0);
}
+ g_free (qrow[3]);
- } else {
- g_clear_error (&error);
}
-
-
+
+ if (array) {
+ g_ptr_array_free (array, TRUE);
+ }
+
+ g_clear_error (&error);
}
/* TODO: When a photo contains a known face
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]