Add ability to use regex for executable switching

Previously, only exact matches to a window title would switch scenes
This commit is contained in:
Myned
2020-05-14 18:49:35 -04:00
parent 228a18eb77
commit b45b38cf6a
2 changed files with 2 additions and 5 deletions

View File

@@ -129,7 +129,7 @@ void SwitcherData::checkExeSwitch(bool& match, OBSWeakSource& scene, OBSWeakSour
GetProcessList(runningProcesses);
for (ExecutableSceneSwitch& s : executableSwitches)
{
if (runningProcesses.contains(s.mExe))
if (runningProcesses.indexOf(QRegularExpression(s.mExe)) != -1)
{
scene = s.mScene;
transition = s.mTransition;

View File

@@ -295,10 +295,7 @@ bool isInFocus(const QString &exeToCheck)
string curWindow;
GetCurrentWindowTitle(curWindow);
return (QString::compare(
QString::fromStdString(curWindow),
exeToCheck,
Qt::CaseInsensitive) == 0) ? true : false;
return QString::fromStdString(curWindow).contains(QRegularExpression(exeToCheck));
}