summaryrefslogtreecommitdiff
path: root/src/executableslist.cpp
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-11 21:35:06 +0100
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-11 21:35:06 +0100
commit5244544424dd7e29d8e489ffeb9b15130b84b8d0 (patch)
treee05b053ae010bf2a80f984774ddda4cb470d4fd9 /src/executableslist.cpp
parentb0d86c9e01659a5058184932e423308dad9c7c29 (diff)
parent0aecc3427a37e4d572c8b111a4b18185e63a7c80 (diff)
Merge
Diffstat (limited to 'src/executableslist.cpp')
-rw-r--r--src/executableslist.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp
index ffb87703..76fe73d7 100644
--- a/src/executableslist.cpp
+++ b/src/executableslist.cpp
@@ -48,6 +48,7 @@ void ExecutablesList::init(IPluginGame *game)
info.binary().absoluteFilePath(),
info.arguments().join(" "),
info.workingDirectory().absolutePath(),
+ info.closeMO(),
info.steamAppID());
}
}
@@ -132,22 +133,19 @@ void ExecutablesList::addExecutable(const QString &title,
const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
+ ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
- Executable::SettableFlags settable,
- bool set_other,
- Executable::OtherFlags other)
+ Executable::Flags flags)
{
QFileInfo file(executableName);
auto existingExe = findExe(title);
if (existingExe != m_Executables.end()) {
existingExe->m_Title = title;
- existingExe->m_SettableFlags = settable;
- if (set_other) {
- existingExe->m_OtherFlags = other;
- }
- // for pre-configured executables don't overwrite settings we didn't store
- if (existingExe->isCustom()) {
+ existingExe->m_CloseMO = closeMO;
+ existingExe->m_Flags = flags;
+ if (flags & Executable::CustomExecutable) {
+ // for pre-configured executables don't overwrite settings we didn't store
existingExe->m_BinaryInfo = file;
existingExe->m_Arguments = arguments;
existingExe->m_WorkingDirectory = workingDirectory;
@@ -156,12 +154,12 @@ void ExecutablesList::addExecutable(const QString &title,
} else {
Executable newExe;
newExe.m_Title = title;
+ newExe.m_CloseMO = closeMO;
newExe.m_BinaryInfo = file;
newExe.m_Arguments = arguments;
newExe.m_WorkingDirectory = workingDirectory;
newExe.m_SteamAppID = steamAppID;
- newExe.m_SettableFlags = settable;
- newExe.m_OtherFlags = Executable::CustomExecutable | other;
+ newExe.m_Flags = Executable::CustomExecutable | flags;
m_Executables.push_back(newExe);
}
}
@@ -178,22 +176,20 @@ void ExecutablesList::remove(const QString &title)
}
-void ExecutablesList::addExecutableInternal(const QString &title,
- const QString &executableName,
- const QString &arguments,
- const QString &workingDirectory,
- const QString &steamAppID)
+void ExecutablesList::addExecutableInternal(const QString &title, const QString &executableName,
+ const QString &arguments, const QString &workingDirectory,
+ ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID)
{
QFileInfo file(executableName);
if (file.exists()) {
Executable newExe;
+ newExe.m_CloseMO = closeMO;
newExe.m_BinaryInfo = file;
newExe.m_Title = title;
newExe.m_Arguments = arguments;
newExe.m_WorkingDirectory = workingDirectory;
newExe.m_SteamAppID = steamAppID;
- newExe.m_SettableFlags = 0;
- newExe.m_OtherFlags = 0;
+ newExe.m_Flags = 0;
m_Executables.push_back(newExe);
}
}
@@ -201,9 +197,8 @@ void ExecutablesList::addExecutableInternal(const QString &title,
void Executable::showOnToolbar(bool state)
{
- if (state) {
- m_OtherFlags |= ShowInToolbar;
- } else {
- m_OtherFlags &= ~ShowInToolbar;
- }
+ if (state)
+ m_Flags |= ShowInToolbar;
+ else
+ m_Flags &= ~ShowInToolbar;
}