From 2af6ee883b0c6067b1b4846cc7f0a186899ecaf8 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:57:37 +0200 Subject: [PATCH] Fix process condition not respecting regex options --- plugins/base/macro-condition-process.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/base/macro-condition-process.cpp b/plugins/base/macro-condition-process.cpp index 785372c4..af608001 100644 --- a/plugins/base/macro-condition-process.cpp +++ b/plugins/base/macro-condition-process.cpp @@ -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) {