summaryrefslogtreecommitdiffstats
path: root/logic/pathmatcher/RegexpMatcher.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-10-10 05:55:55 +0200
committerPetr Mrázek <peterix@gmail.com>2015-10-10 05:55:55 +0200
commit44db72ead568fe7ce22e1999aac02fd9aac9beea (patch)
treeb03d7fa01a0b2ef772c2770e2db99bc8aa69c768 /logic/pathmatcher/RegexpMatcher.h
parent4fbcb3efb90368c084946600afdca05ca7c65519 (diff)
downloadMultiMC-44db72ead568fe7ce22e1999aac02fd9aac9beea.tar
MultiMC-44db72ead568fe7ce22e1999aac02fd9aac9beea.tar.gz
MultiMC-44db72ead568fe7ce22e1999aac02fd9aac9beea.tar.lz
MultiMC-44db72ead568fe7ce22e1999aac02fd9aac9beea.tar.xz
MultiMC-44db72ead568fe7ce22e1999aac02fd9aac9beea.zip
GH-93 add an option to not copy saves on instance copy
Diffstat (limited to 'logic/pathmatcher/RegexpMatcher.h')
-rw-r--r--logic/pathmatcher/RegexpMatcher.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/logic/pathmatcher/RegexpMatcher.h b/logic/pathmatcher/RegexpMatcher.h
index f3cf90b1..da552123 100644
--- a/logic/pathmatcher/RegexpMatcher.h
+++ b/logic/pathmatcher/RegexpMatcher.h
@@ -5,13 +5,26 @@ class RegexpMatcher : public IPathMatcher
{
public:
virtual ~RegexpMatcher() {};
- RegexpMatcher(QString regexp)
+ RegexpMatcher(const QString &regexp)
{
m_regexp.setPattern(regexp);
m_onlyFilenamePart = !regexp.contains('/');
}
- virtual bool matches(const QString &string) override
+ RegexpMatcher &caseSensitive(bool cs = true)
+ {
+ if(cs)
+ {
+ m_regexp.setPatternOptions(QRegularExpression::CaseInsensitiveOption);
+ }
+ else
+ {
+ m_regexp.setPatternOptions(QRegularExpression::NoPatternOption);
+ }
+ return *this;
+ }
+
+ virtual bool matches(const QString &string) const override
{
if(m_onlyFilenamePart)
{