From 45f83c56da45805c58d588a69d4d67629f8281ab Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 16 Jul 2013 11:10:01 -0400 Subject: [PATCH] Updated with Josh's suggestions --- openbr/plugins/misc.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 8a1f713..4ae217a 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -35,19 +35,17 @@ class OpenTransform : public UntrainableMetaTransform void project(const Template &src, Template &dst) const { - if (!src.m().empty()) dst.append(src.clone()); - else { - if (Globals->verbose) qDebug("Opening %s", qPrintable(src.file.flat())); - dst.file = src.file; - foreach (const File &file, src.file.split()) { - QScopedPointer format(Factory::make(file)); - Template t = format->read(); - if (t.isEmpty()) qWarning("Can't open %s from %s", qPrintable(file.flat()), qPrintable(QDir::currentPath())); - dst.append(t); - dst.file.append(t.file.localMetadata()); - } - dst.file.set("FTO", dst.isEmpty()); + if (!src.isEmpty()) { dst = src; return; } + if (Globals->verbose) qDebug("Opening %s", qPrintable(src.file.flat())); + dst.file = src.file; + foreach (const File &file, src.file.split()) { + QScopedPointer format(Factory::make(file)); + Template t = format->read(); + if (t.isEmpty()) qWarning("Can't open %s from %s", qPrintable(file.flat()), qPrintable(QDir::currentPath())); + dst.append(t); + dst.file.append(t.file.localMetadata()); } + dst.file.set("FTO", dst.isEmpty()); } }; -- libgit2 0.21.4