summaryrefslogtreecommitdiff
path: root/src/executableslist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/executableslist.cpp')
-rw-r--r--src/executableslist.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp
index 76fe73d7..7002ccc4 100644
--- a/src/executableslist.cpp
+++ b/src/executableslist.cpp
@@ -129,23 +129,26 @@ void ExecutablesList::addExecutable(const Executable &executable)
}
-void ExecutablesList::addExecutable(const QString &title,
- const QString &executableName,
- const QString &arguments,
- const QString &workingDirectory,
- ExecutableInfo::CloseMOStyle closeMO,
- const QString &steamAppID,
- Executable::Flags flags)
+void ExecutablesList::updateExecutable(const QString &title,
+ const QString &executableName,
+ const QString &arguments,
+ const QString &workingDirectory,
+ ExecutableInfo::CloseMOStyle closeMO,
+ const QString &steamAppID,
+ Executable::Flags mask,
+ Executable::Flags flags)
{
QFileInfo file(executableName);
auto existingExe = findExe(title);
+ flags &= mask;
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_Flags &= ~mask;
+ existingExe->m_Flags |= flags;
+ // 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;
@@ -197,8 +200,9 @@ void ExecutablesList::addExecutableInternal(const QString &title, const QString
void Executable::showOnToolbar(bool state)
{
- if (state)
+ if (state) {
m_Flags |= ShowInToolbar;
- else
+ } else {
m_Flags &= ~ShowInToolbar;
+ }
}