Fix process condition not respecting regex options

This commit is contained in:
WarmUpTill
2024-09-28 12:57:37 +02:00
committed by WarmUpTill
parent 0e9875e6b5
commit 2af6ee883b

View File

@@ -33,8 +33,16 @@ bool MacroConditionProcess::CheckCondition()
return false;
}
auto matchIndex = runningProcesses.indexOf(QRegularExpression(proc));
if (matchIndex == -1) {
int matchIndex = -1;
bool foundMatch = false;
for (const auto &process : runningProcesses) {
matchIndex++;
if (_regex.Matches(process, proc)) {
foundMatch = true;
break;
}
}
if (!foundMatch) {
return false;
}
if (!_checkFocus) {