summaryrefslogtreecommitdiff
path: root/src/executableslist.cpp
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-05 22:40:49 +0100
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-08-05 22:40:49 +0100
commitb0982148609a8a6f0d73d801ec9fcd1a22930f98 (patch)
tree4075050e1b7bc8555ddafb71259c07134cc2dff5 /src/executableslist.cpp
parent9f7bec01d00ffc518ac9ec0c52e1a7184ea3cfac (diff)
More work on the executables list
Apart from an off by one in the popup list which had crept back in, reworked the underlying code even more, which now seems to get the list behaving in a predictable way.
Diffstat (limited to 'src/executableslist.cpp')
-rw-r--r--src/executableslist.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp
index 5a870009..ffb87703 100644
--- a/src/executableslist.cpp
+++ b/src/executableslist.cpp
@@ -48,7 +48,6 @@ void ExecutablesList::init(IPluginGame *game)
info.binary().absoluteFilePath(),
info.arguments().join(" "),
info.workingDirectory().absolutePath(),
- info.closeMO(),
info.steamAppID());
}
}
@@ -133,19 +132,22 @@ void ExecutablesList::addExecutable(const QString &title,
const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
- ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
- Executable::Flags flags)
+ Executable::SettableFlags settable,
+ bool set_other,
+ Executable::OtherFlags other)
{
QFileInfo file(executableName);
auto existingExe = findExe(title);
if (existingExe != m_Executables.end()) {
existingExe->m_Title = title;
- 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_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_BinaryInfo = file;
existingExe->m_Arguments = arguments;
existingExe->m_WorkingDirectory = workingDirectory;
@@ -154,12 +156,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_Flags = Executable::CustomExecutable | flags;
+ newExe.m_SettableFlags = settable;
+ newExe.m_OtherFlags = Executable::CustomExecutable | other;
m_Executables.push_back(newExe);
}
}
@@ -176,20 +178,22 @@ void ExecutablesList::remove(const QString &title)
}
-void ExecutablesList::addExecutableInternal(const QString &title, const QString &executableName,
- const QString &arguments, const QString &workingDirectory,
- ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID)
+void ExecutablesList::addExecutableInternal(const QString &title,
+ const QString &executableName,
+ const QString &arguments,
+ const QString &workingDirectory,
+ 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_Flags = 0;
+ newExe.m_SettableFlags = 0;
+ newExe.m_OtherFlags = 0;
m_Executables.push_back(newExe);
}
}
@@ -197,8 +201,9 @@ void ExecutablesList::addExecutableInternal(const QString &title, const QString
void Executable::showOnToolbar(bool state)
{
- if (state)
- m_Flags |= ShowInToolbar;
- else
- m_Flags ^= ShowInToolbar;
+ if (state) {
+ m_OtherFlags |= ShowInToolbar;
+ } else {
+ m_OtherFlags &= ~ShowInToolbar;
+ }
}