aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ResourcePack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/mod/ResourcePack.cpp')
-rw-r--r--launcher/minecraft/mod/ResourcePack.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/ResourcePack.cpp b/launcher/minecraft/mod/ResourcePack.cpp
index cab20b50..5f45254d 100644
--- a/launcher/minecraft/mod/ResourcePack.cpp
+++ b/launcher/minecraft/mod/ResourcePack.cpp
@@ -2,6 +2,7 @@
#include <QDebug>
#include <QMap>
+#include <QRegularExpression>
#include "Version.h"
@@ -69,3 +70,19 @@ std::pair<int, bool> ResourcePack::compare(const Resource& other, SortType type)
}
return { 0, false };
}
+
+bool ResourcePack::applyFilter(QRegularExpression filter) const
+{
+ if (filter.match(description()).hasMatch())
+ return true;
+
+ if (filter.match(QString::number(packFormat())).hasMatch())
+ return true;
+
+ if (filter.match(compatibleVersions().first.toString()).hasMatch())
+ return true;
+ if (filter.match(compatibleVersions().second.toString()).hasMatch())
+ return true;
+
+ return Resource::applyFilter(filter);
+}