From bbc438700fe316536528382176fb5e879f4ab63e Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Wed, 9 Nov 2016 10:55:06 -0700 Subject: [PATCH] Added enumerate option for empty gallery --- openbr/plugins/gallery/empty.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/gallery/empty.cpp b/openbr/plugins/gallery/empty.cpp index b488d3d..15cba47 100644 --- a/openbr/plugins/gallery/empty.cpp +++ b/openbr/plugins/gallery/empty.cpp @@ -36,6 +36,7 @@ class EmptyGallery : public Gallery BR_PROPERTY(QString, regexp, QString()) qint64 gallerySize; + qint64 filesWritten; void init() { @@ -47,6 +48,7 @@ class EmptyGallery : public Gallery it.next(); gallerySize++; } + filesWritten = 0; } TemplateList readBlock(bool *done) @@ -95,7 +97,9 @@ class EmptyGallery : public Gallery const QString newFormat = file.get("newFormat",QString()); QString destination = file.name + "/" + (file.getBool("preservePath") ? t.file.path()+"/" : QString()); - destination += (newFormat.isEmpty() ? t.file.fileName() : t.file.baseName()+newFormat); + const bool enumerate = file.get("enumerate",false); + destination += t.file.baseName() + (enumerate ? "_"+QString::number(filesWritten++) : QString()); + destination += newFormat.isEmpty() ? t.file.suffix() : newFormat; QMutexLocker diskLocker(&diskLock); // Windows prefers to crash when writing to disk in parallel if (t.isNull()) { -- libgit2 0.21.4