summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qthelper.cpp14
-rw-r--r--core/qthelper.h1
2 files changed, 11 insertions, 4 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 79fc0effc..0cf37fffb 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1173,9 +1173,18 @@ extern "C" void cache_picture(struct picture *picture)
QtConcurrent::run(hashPicture, clone_picture(picture));
}
+QStringList imageExtensionFilters() {
+ QStringList filters;
+ foreach (QString format, QImageReader::supportedImageFormats()) {
+ filters.append(QString("*.").append(format));
+ }
+ return filters;
+}
+
void learnImages(const QDir dir, int max_recursions)
{
- QStringList filters, files;
+ QStringList files;
+ QStringList filters = imageExtensionFilters();
if (max_recursions) {
foreach (QString dirname, dir.entryList(QStringList(), QDir::NoDotAndDotDot | QDir::Dirs)) {
@@ -1183,9 +1192,6 @@ void learnImages(const QDir dir, int max_recursions)
}
}
- foreach (QString format, QImageReader::supportedImageFormats()) {
- filters.append(QString("*.").append(format));
- }
foreach (QString file, dir.entryList(filters, QDir::Files)) {
files.append(dir.absoluteFilePath(file));
diff --git a/core/qthelper.h b/core/qthelper.h
index 9788bb55d..e0e4da0c5 100644
--- a/core/qthelper.h
+++ b/core/qthelper.h
@@ -46,5 +46,6 @@ extern "C" enum deco_mode decoMode();
extern "C" void subsurface_mkdir(const char *dir);
void init_proxy();
QString getUUID();
+QStringList imageExtensionFilters();
#endif // QTHELPER_H