summaryrefslogtreecommitdiff
path: root/src/MetadataWriter.vala
diff options
context:
space:
mode:
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);