From a7d6eb75c20d185c45a0bff309c68e1efaae990e Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 9 Aug 2015 15:16:57 +0200 Subject: reverted most changes of changeset 626da419828a as I don't agree with them --- src/executableslist.cpp | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) (limited to 'src/executableslist.cpp') 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; } -- cgit v1.3.1