summaryrefslogtreecommitdiff
path: root/src/spawn.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-09-19 11:23:21 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-09-19 11:23:21 -0400
commita5db7ed864ac58657bf9bfbbc292cdccbeeaa38b (patch)
tree546c849f8b7623e8639d02d468ad658c6a8c3918 /src/spawn.cpp
parent8bc67a86d64c86cf7f1eeb2c656dd414c0716d0b (diff)
added Settings::isExecutableBlacklisted()
moved blacklisted confirmation to dialogs
Diffstat (limited to 'src/spawn.cpp')
-rw-r--r--src/spawn.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp
index c9025d98..45324d79 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -345,6 +345,20 @@ bool eventLogNotRunning(
return (r != QDialogButtonBox::No);
}
+bool confirmBlacklisted(QWidget* parent, const SpawnParameters& sp)
+{
+ const auto r = QuestionBoxMemory::query(
+ parent, QString("blacklistedExecutable"), sp.binary.fileName(),
+ QObject::tr("Blacklisted Executable"),
+ QObject::tr("The executable you are attempted to launch is blacklisted in the virtual file"
+ " system. This will likely prevent the executable, and any executables that are"
+ " launched by this one, from seeing any mods. This could extend to INI files, save"
+ " games and any other virtualized files.\n\nContinue launching %1?").arg(sp.binary.fileName()),
+ QDialogButtonBox::Yes | QDialogButtonBox::No);
+
+ return (r != QDialogButtonBox::No);
+}
+
} // namespace
@@ -652,18 +666,8 @@ bool checkEnvironment(QWidget* parent, const SpawnParameters& sp)
bool checkBlacklist(QWidget* parent, const SpawnParameters& sp, const Settings& settings)
{
- for (auto exec : settings.executablesBlacklist().split(";")) {
- if (exec.compare(sp.binary.fileName(), Qt::CaseInsensitive) == 0) {
- if (QuestionBoxMemory::query(parent, QString("blacklistedExecutable"), sp.binary.fileName(),
- QObject::tr("Blacklisted Executable"),
- QObject::tr("The executable you are attempted to launch is blacklisted in the virtual file"
- " system. This will likely prevent the executable, and any executables that are"
- " launched by this one, from seeing any mods. This could extend to INI files, save"
- " games and any other virtualized files.\n\nContinue launching %1?").arg(sp.binary.fileName()),
- QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::No) {
- return false;
- }
- }
+ if (settings.isExecutableBlacklisted(sp.binary.fileName())) {
+ return dialogs::confirmBlacklisted(parent, sp);
}
return true;
@@ -779,7 +783,6 @@ bool backdateBSAs(const std::wstring &moPath, const std::wstring &dataPath)
return helperExec(moPath, commandLine, FALSE);
}
-
bool adminLaunch(const std::wstring &moPath, const std::wstring &moFile, const std::wstring &workingDir)
{
const std::wstring commandLine = fmt::format(