diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-03 13:14:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-03 13:14:53 +0200 |
commit | c43dfb815a4951b8248f4f0e98babe4f80204f03 (patch) | |
tree | 82745ed2353757c41ea1865bad9ac7a1b0a8a366 /src/MetadataWriter.vala | |
parent | 2785a691b958a79a1dd606c445188c71c3f58b3c (diff) |
Imported Upstream version 0.22.0upstream/0.22.0
Diffstat (limited to 'src/MetadataWriter.vala')
-rw-r--r-- | src/MetadataWriter.vala | 27 |
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); |