From 13d79f3cbe35e233e575d236b8678db8c5e2d62b Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Mon, 8 Jun 2020 18:37:05 +0200 Subject: Add findFiles overload with glob patterns. --- src/organizercore.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index efb98cca..27f54d4b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -862,9 +862,10 @@ QStringList OrganizerCore::findFiles( dir = dir->findSubDirectoryRecursive(ToWString(path)); if (dir != nullptr) { std::vector files = dir->getFiles(); - foreach (FileEntryPtr file, files) { - if (filter(ToQString(file->getFullPath()))) { - result.append(ToQString(file->getFullPath())); + for (FileEntryPtr &file: files) { + QString fullPath = QString::fromStdWString(file->getFullPath()); + if (filter(fullPath)) { + result.append(fullPath); } } } -- cgit v1.3.1 From 0d873719eb6324226eb3b20540797afb6ae20f26 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Mon, 8 Jun 2020 20:51:11 +0200 Subject: Replace QString::fromStdWString by ToQString. --- src/organizercore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/organizercore.cpp') diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 27f54d4b..b167b8e3 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -863,7 +863,7 @@ QStringList OrganizerCore::findFiles( if (dir != nullptr) { std::vector files = dir->getFiles(); for (FileEntryPtr &file: files) { - QString fullPath = QString::fromStdWString(file->getFullPath()); + QString fullPath = ToQString(file->getFullPath()); if (filter(fullPath)) { result.append(fullPath); } -- cgit v1.3.1