diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-06-08 18:37:05 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-06-08 18:37:05 +0200 |
| commit | 13d79f3cbe35e233e575d236b8678db8c5e2d62b (patch) | |
| tree | 297e1241cff50eef41dd627888fef9b359174087 /src/organizerproxy.cpp | |
| parent | 4e0d47868ab78c58afca0733d3686c7dc3c6a4d9 (diff) | |
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);
|
