From 3464894902d9605950872d75a8ba250e2c4d41a3 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Wed, 13 Aug 2014 14:55:51 -0400 Subject: [PATCH] Fixed emptygallery progress bug --- openbr/plugins/gallery.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 48c8040..1fc9ff6 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -145,6 +145,7 @@ class BinaryGallery : public Gallery gallery.seek(0); TemplateList templates; + qDebug() << "testing..."; while ((templates.size() < readBlockSize) && !gallery.atEnd()) { const Template t = readTemplate(); if (!t.isEmpty() || !t.file.isNull()) { @@ -385,9 +386,13 @@ class EmptyGallery : public Gallery Q_PROPERTY(QString regexp READ get_regexp WRITE set_regexp RESET reset_regexp STORED false) BR_PROPERTY(QString, regexp, QString()) + qint64 gallerySize; + void init() { - QtUtils::touchDir(QDir(file.name)); + QDir dir(file.name); + QtUtils::touchDir(dir); + gallerySize = dir.count(); } TemplateList readBlock(bool *done) @@ -422,6 +427,8 @@ class EmptyGallery : public Gallery } } + for (int i = 0; i < templates.size(); i++) templates[i].file.set("progress", i); + return templates; } @@ -445,6 +452,11 @@ class EmptyGallery : public Gallery } } + qint64 totalSize() + { + return gallerySize; + } + static TemplateList getTemplates(const QDir &dir) { const QStringList files = QtUtils::getFiles(dir, true); -- libgit2 0.21.4