summaryrefslogtreecommitdiff
path: root/src/MetadataWriter.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:15:00 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-04-03 13:15:00 +0200
commitbc53b714952ceb0afd02b591403cb2bc0cb1aab9 (patch)
tree8ff57ed1a1265b2c87f37e3c8fa19876faf80990 /src/MetadataWriter.vala
parentd4c476947425c12b1984fedea16f8a8c42a07ba3 (diff)
parentc43dfb815a4951b8248f4f0e98babe4f80204f03 (diff)
Merge tag 'upstream/0.22.0'
Upstream version 0.22.0
Diffstat (limited to 'src/MetadataWriter.vala')
-rw-r--r--src/MetadataWriter.vala27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/MetadataWriter.vala b/src/MetadataWriter.vala
index aee5855..969506e 100644
--- a/src/MetadataWriter.vala
+++ b/src/MetadataWriter.vala
@@ -1,4 +1,4 @@
-/* Copyright 2010-2014 Yorba Foundation
+/* Copyright 2010-2015 Yorba Foundation
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
@@ -23,6 +23,8 @@ public class MetadataWriter : Object {
public Photo.ReimportMasterState reimport_master_state = null;
public Photo.ReimportEditableState reimport_editable_state = null;
public Error? err = null;
+ public bool wrote_master = false;
+ public bool wrote_editable = false;
public CommitJob(MetadataWriter owner, LibraryPhoto photo, Gee.Set<string>? keywords) {
base (owner, owner.on_update_completed, new Cancellable(), owner.on_update_cancelled);
@@ -58,6 +60,8 @@ public class MetadataWriter : Object {
LibraryMonitor.unblacklist_file(photo.get_master_file());
}
}
+
+ wrote_master = true;
}
private void commit_editable() throws Error {
@@ -75,6 +79,8 @@ public class MetadataWriter : Object {
LibraryMonitor.unblacklist_file(photo.get_editable_file());
}
}
+
+ wrote_editable = true;
}
private bool update_metadata(PhotoMetadata metadata, bool skip_orientation = false) {
@@ -617,10 +623,21 @@ public class MetadataWriter : Object {
private void on_update_completed(BackgroundJob j) {
CommitJob job = (CommitJob) j;
- if (job.err != null)
- warning("Unable to update metadata for %s: %s", job.photo.to_string(), job.err.message);
- else
- message("Completed writing metadata for %s", job.photo.to_string());
+ if (job.err != null) {
+ warning("Unable to write metadata to %s: %s", job.photo.to_string(), job.err.message);
+ } else {
+ if (job.wrote_master)
+ message("Completed writing metadata to %s", job.photo.get_master_file().get_path());
+ else
+ message("Unable to write metadata to %s", job.photo.get_master_file().get_path());
+
+ if (job.photo.get_editable_file() != null) {
+ if (job.wrote_editable)
+ message("Completed writing metadata to %s", job.photo.get_editable_file().get_path());
+ else
+ message("Unable to write metadata to %s", job.photo.get_editable_file().get_path());
+ }
+ }
bool removed = pending.unset(job.photo);
assert(removed);