Add option to set enabled state for partial match regex config

This commit is contained in:
WarmUpTill 2024-10-04 18:55:15 +02:00 committed by WarmUpTill
parent 9a4d2935f8
commit 140dc9c6f4
2 changed files with 6 additions and 5 deletions

View File

@ -79,11 +79,12 @@ bool RegexConfig::Matches(const std::string &text,
QString::fromStdString(expression));
}
RegexConfig RegexConfig::PartialMatchRegexConfig()
RegexConfig RegexConfig::PartialMatchRegexConfig(bool enabled)
{
RegexConfig conf;
conf._partialMatch = true;
return conf;
RegexConfig regex;
regex._partialMatch = true;
regex._enable = enabled;
return regex;
}
RegexConfigWidget::RegexConfigWidget(QWidget *parent, bool showEnable)

View File

@ -37,7 +37,7 @@ public:
EXPORT bool Matches(const std::string &text,
const std::string &expression) const;
EXPORT static RegexConfig PartialMatchRegexConfig();
EXPORT static RegexConfig PartialMatchRegexConfig(bool enabled = false);
private:
bool _enable = false;