Add direct matching to window, executable, and ignored switches

Reverts part of commit 5f87a61177

Direct matching occurs in the same loop as regex in order to allow the list order to function as indicated in the UI
This commit is contained in:
Myned
2020-05-17 13:42:50 -04:00
parent f0aa76517a
commit d5052c94ca
3 changed files with 30 additions and 9 deletions

View File

@@ -295,7 +295,12 @@ bool isInFocus(const QString &exeToCheck)
string curWindow;
GetCurrentWindowTitle(curWindow);
return QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck));
// True if executable switch equals current window
bool equals = (exeToCheck.toStdString() == curWindow);
// True if executable switch matches current window
bool matches = QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck));
return (equals || matches);
}