Fixed: Only ask once if user want to uninstall Ryzom, see #279

--HG--
branch : develop
This commit is contained in:
kervala 2016-09-14 08:14:56 +02:00
parent 7191bf1b41
commit 75d3db65e8
2 changed files with 17 additions and 2 deletions

View file

@ -27,7 +27,8 @@
CConfigFile *CConfigFile::s_instance = NULL;
CConfigFile::CConfigFile(QObject *parent):QObject(parent), m_version(-1),
m_defaultServerIndex(0), m_defaultProfileIndex(0), m_use64BitsClient(false), m_shouldUninstallOldClient(true)
m_defaultServerIndex(0), m_defaultProfileIndex(0), m_use64BitsClient(false), m_shouldUninstallOldClient(true),
m_uninstallingOldClient(false)
{
s_instance = this;
@ -461,6 +462,16 @@ void CConfigFile::setShouldUninstallOldClient(bool on)
m_shouldUninstallOldClient = on;
}
bool CConfigFile::uninstallingOldClient() const
{
return m_uninstallingOldClient;
}
void CConfigFile::setUninstallingOldClient(bool on)
{
m_uninstallingOldClient = on;
}
QString CConfigFile::expandVariables(const QString &str) const
{
QString res = str;
@ -972,7 +983,7 @@ OperationStep CConfigFile::getInstallNextStep() const
if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry;
#endif
if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
if (!m_uninstallingOldClient && m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
{
return UninstallOldClient;
}

View file

@ -109,6 +109,9 @@ public:
bool shouldUninstallOldClient() const;
void setShouldUninstallOldClient(bool on);
bool uninstallingOldClient() const;
void setUninstallingOldClient(bool on);
QString expandVariables(const QString &str) const;
QString getClientArch() const;
@ -147,6 +150,7 @@ private:
QString m_srcDirectory;
bool m_use64BitsClient;
bool m_shouldUninstallOldClient;
bool m_uninstallingOldClient;
QString m_language;
QString m_defaultConfigPath;