GH-93 add an option to not copy saves on instance copy

This commit is contained in:
Petr Mrázek
2015-10-10 05:55:55 +02:00
parent 4fbcb3efb9
commit 44db72ead5
10 changed files with 138 additions and 60 deletions

View File

@ -8,5 +8,5 @@ public:
public:
virtual ~IPathMatcher(){};
virtual bool matches(const QString &string) = 0;
virtual bool matches(const QString &string) const = 0;
};

View File

@ -15,7 +15,7 @@ public:
return *this;
}
virtual bool matches(const QString &string) override
virtual bool matches(const QString &string) const override
{
for(auto iter: m_matchers)
{

View File

@ -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)
{