Merge with develop

This commit is contained in:
kervala 2016-09-21 15:52:53 +02:00
parent faff5ad04d
commit 1e733fec01
6 changed files with 48 additions and 27 deletions

View file

@ -466,7 +466,7 @@ bool CConfigFile::uninstallingOldClient() const
return QFile::exists(getInstallationDirectory() + "/ryzom_installer_uninstalling_old_client");
}
void CConfigFile::setUninstallingOldClient(bool on)
void CConfigFile::setUninstallingOldClient(bool on) const
{
QString filename = getInstallationDirectory() + "/ryzom_installer_uninstalling_old_client";
@ -999,9 +999,19 @@ OperationStep CConfigFile::getInstallNextStep() const
if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry;
#endif
if (!uninstallingOldClient() && m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty())
{
return UninstallOldClient;
// if old client must be uninstalled
if (!uninstallingOldClient() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
{
return UninstallOldClient;
}
// if old client has been uninstalled
if (uninstallingOldClient() && !QFile::exists(getSrcServerDirectory() + "/Uninstall.exe"))
{
setUninstallingOldClient(false);
}
}
return Done;

View file

@ -112,7 +112,7 @@ public:
void setShouldUninstallOldClient(bool on);
bool uninstallingOldClient() const;
void setUninstallingOldClient(bool on);
void setUninstallingOldClient(bool on) const;
QString expandVariables(const QString &str) const;

View file

@ -80,26 +80,6 @@ bool copyInstallerFiles(const QStringList &files, const QString &destination)
return true;
}
#ifdef Q_OS_WIN
class CCOMHelper
{
bool m_mustUninit;
public:
CCOMHelper()
{
// to fix the bug with QFileDialog::getExistingDirectory hanging under Windows
m_mustUninit = SUCCEEDED(CoInitialize(NULL));
}
~CCOMHelper()
{
// only call CoUninitialize if CoInitialize succeeded
if (m_mustUninit) CoUninitialize();
}
};
#endif
int main(int argc, char *argv[])
{
#if defined(_MSC_VER) && defined(_DEBUG)

View file

@ -31,7 +31,7 @@ QString qBytesToHumanReadable(qint64 bytes)
units.push_back(QObject::tr("PiB").toUtf8().constData());
}
return QString::fromUtf8(NLMISC::bytesToHumanReadable(bytes).c_str());
return QString::fromUtf8(NLMISC::bytesToHumanReadableUnits(bytes, units).c_str());
}
qint64 getDirectorySize(const QString &directory, bool recursize)
@ -99,6 +99,8 @@ wchar_t* qToWide(const QString &str)
bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir)
{
CCOMHelper comHelper;
IShellLinkW* psl;
// Get a pointer to the IShellLink interface. It is assumed that CoInitialize
@ -135,6 +137,8 @@ bool createLink(const QString &link, const QString &name, const QString &executa
bool resolveLink(const QWidget &window, const QString &linkFile, QString &path)
{
CCOMHelper comHelper;
IShellLinkW* psl;
WIN32_FIND_DATAW wfd;
@ -239,3 +243,21 @@ bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathOb
}
#endif
CCOMHelper::CCOMHelper()
{
#ifdef Q_OS_WIN
// to fix the bug with QFileDialog::getExistingDirectory hanging under Windows
m_mustUninit = SUCCEEDED(CoInitialize(NULL));
#else
m_mustUninit = false;
#endif
}
CCOMHelper::~CCOMHelper()
{
#ifdef Q_OS_WIN
// only call CoUninitialize if CoInitialize succeeded
if (m_mustUninit) CoUninitialize();
#endif
}

View file

@ -51,4 +51,13 @@ wchar_t* qToWide(const QString &str);
bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir);
bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj);
class CCOMHelper
{
bool m_mustUninit;
public:
CCOMHelper();
~CCOMHelper();
};
#endif

View file

@ -559,9 +559,9 @@ This program will migrate Ryzom version 2.1 to 3.0. Your files will be updated,
Just press Continue button and follow the different steps until everything is done.</source>
<translation>Bienvenue dans l&apos;Installateur de Ryzom !
Ce programme vous permettra de télécharger, installer, configurer et gérer Ryzom sur votre ordinateur.
Ce programme vous permettra de migrer Ryzom de la version 2.1 à 3.0. Vos fichiers seront mis à jour, nettoyés et déplacés vers un nouvel emplacement.
Vous n&apos;avez qu&apos;à suivre les différentes étapes et faire un choix entre les différentes options proposées. </translation>
Vous n&apos;avez qu&apos;à cliquer sur Suivant et suivre les différentes étapes jusqu&apos;à la fin. </translation>
</message>
<message>
<location filename="../ui/migratedialog.ui" line="61"/>