From c43dfb815a4951b8248f4f0e98babe4f80204f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 3 Apr 2015 13:14:53 +0200 Subject: Imported Upstream version 0.22.0 --- src/MetadataWriter.vala | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/MetadataWriter.vala') 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? 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); -- cgit v1.2.3