diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2020-06-08 12:04:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-08 12:04:54 -0700 |
| commit | 29893868dc318ba949b0ddc5aa996091dc9ac11b (patch) | |
| tree | 192e67244374b56e169003a71ad0ff9463567ac4 /src/organizerproxy.cpp | |
| parent | 4e0d47868ab78c58afca0733d3686c7dc3c6a4d9 (diff) | |
| parent | 1aedff5c60cce4b4dda0ca52d0d235361232752f (diff) | |
Merge pull request #1114 from Holt59/iorganizer-findfiles-glob
Add findFiles overload with glob patterns.
Diffstat (limited to 'src/organizerproxy.cpp')
| -rw-r--r-- | src/organizerproxy.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index e67952d9..d728ecad 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -4,6 +4,7 @@ #include "organizercore.h"
#include "plugincontainer.h"
#include "settings.h"
+#include "glob_matching.h"
#include <QObject>
#include <QApplication>
@@ -217,6 +218,22 @@ QStringList OrganizerProxy::findFiles(const QString &path, const std::function<b return m_Proxied->findFiles(path, filter);
}
+QStringList OrganizerProxy::findFiles(const QString& path, const QStringList& globFilters) const
+{
+ QList<GlobPattern<QChar>> patterns;
+ for (auto& gfilter : globFilters) {
+ patterns.append(GlobPattern(gfilter));
+ }
+ return findFiles(path, [&patterns](const QString& filename) {
+ for (auto& p : patterns) {
+ if (p.match(filename)) {
+ return true;
+ }
+ }
+ return false;
+ });
+}
+
QStringList OrganizerProxy::getFileOrigins(const QString &fileName) const
{
return m_Proxied->getFileOrigins(fileName);
|
