Commit bbc438700fe316536528382176fb5e879f4ab63e

Authored by Scott Klum
1 parent 764d5795

Added enumerate option for empty gallery

openbr/plugins/gallery/empty.cpp
... ... @@ -36,6 +36,7 @@ class EmptyGallery : public Gallery
36 36 BR_PROPERTY(QString, regexp, QString())
37 37  
38 38 qint64 gallerySize;
  39 + qint64 filesWritten;
39 40  
40 41 void init()
41 42 {
... ... @@ -47,6 +48,7 @@ class EmptyGallery : public Gallery
47 48 it.next();
48 49 gallerySize++;
49 50 }
  51 + filesWritten = 0;
50 52 }
51 53  
52 54 TemplateList readBlock(bool *done)
... ... @@ -95,7 +97,9 @@ class EmptyGallery : public Gallery
95 97  
96 98 const QString newFormat = file.get<QString>("newFormat",QString());
97 99 QString destination = file.name + "/" + (file.getBool("preservePath") ? t.file.path()+"/" : QString());
98   - destination += (newFormat.isEmpty() ? t.file.fileName() : t.file.baseName()+newFormat);
  100 + const bool enumerate = file.get<bool>("enumerate",false);
  101 + destination += t.file.baseName() + (enumerate ? "_"+QString::number(filesWritten++) : QString());
  102 + destination += newFormat.isEmpty() ? t.file.suffix() : newFormat;
99 103  
100 104 QMutexLocker diskLocker(&diskLock); // Windows prefers to crash when writing to disk in parallel
101 105 if (t.isNull()) {
... ...