From f888b9f3bf0d89caf388cd61b6ee3f45e450123a Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 29 Sep 2016 20:47:46 +0200 Subject: [PATCH] Merge with develop --- .../client/ryzom_installer/src/configfile.cpp | 12 +++++++----- .../client/ryzom_installer/src/configfile.h | 1 + .../ryzom_installer/src/operationdialog.cpp | 3 +++ .../tools/client/ryzom_installer/src/profile.cpp | 16 ++-------------- .../tools/client/ryzom_installer/src/utils.cpp | 12 ++++++------ 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 6466f299e..c9ca60b9e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -188,6 +188,11 @@ bool CConfigFile::save() const return true; } +bool CConfigFile::remove() +{ + return QFile::remove(m_configPath); +} + CConfigFile* CConfigFile::getInstance() { return s_instance; @@ -729,11 +734,8 @@ QString CConfigFile::getInstallerOriginalDirPath() const QString CConfigFile::getInstallerMenuLinkFullPath() const { -#ifdef Q_OS_WIN32 - return QString("%1/%2/%2 Installer.lnk").arg(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).arg(QApplication::applicationName()); -#else - return ""; -#endif + // don't put extension + return QString("%1/%2/%2 Installer").arg(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).arg(QApplication::applicationName()); } QStringList CConfigFile::getInstallerRequiredFiles() const diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index a279e6d7a..3203cb812 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -38,6 +38,7 @@ public: bool load(); bool load(const QString &filename); bool save() const; + bool remove(); static CConfigFile* getInstance(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index ff63cd660..dd6dde356 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1179,6 +1179,9 @@ void COperationDialog::deleteComponentsInstaller() } } + // delete configuration file + config->remove(); + // reset it once it's done m_removeComponents.installer = false; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profile.cpp b/code/ryzom/tools/client/ryzom_installer/src/profile.cpp index 83cbe4205..bc15c5508 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profile.cpp @@ -65,24 +65,12 @@ QString CProfile::getClientFullPath() const QString CProfile::getClientDesktopShortcutFullPath() const { -#ifdef Q_OS_WIN32 - return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name + ".lnk"; -#elif defined(Q_OS_MAC) - return ""; -#else - return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name + ".desktop"; -#endif + return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name; } QString CProfile::getClientMenuShortcutFullPath() const { -#ifdef Q_OS_WIN32 - return CConfigFile::getInstance()->getMenuDirectory() + "/" + name + ".lnk"; -#elif defined(Q_OS_MAC) - return ""; -#else - return CConfigFile::getInstance()->getMenuDirectory() + "/" + name + ".desktop"; -#endif + return CConfigFile::getInstance()->getMenuDirectory() + "/" + name; } void CProfile::createShortcuts() const diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index e150805e0..a06ca053b 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -152,17 +152,15 @@ bool createLink(const QString &link, const QString &name, const QString &executa psl->SetArguments(qToWide(arguments)); psl->SetWorkingDirectory(qToWide(QDir::toNativeSeparators(workingDir))); - // Query IShellLink for the IPersistFile interface, used for saving the - // shortcut in persistent storage. + // Query IShellLink for the IPersistFile interface, used for saving the shortcut in persistent storage. hres = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf); if (SUCCEEDED(hres)) { - // Add code here to check return value from MultiByteWideChar - // for success. + QString path(link + ".lnk"); // Save the link by calling IPersistFile::Save. - hres = ppf->Save(qToWide(QDir::toNativeSeparators(link)), TRUE); + hres = ppf->Save(qToWide(QDir::toNativeSeparators(path)), TRUE); ppf->Release(); } psl->Release(); @@ -261,8 +259,10 @@ bool createLink(const QString &link, const QString &name, const QString &executa data.replace("$COMMAND", command); data.replace("$ICON", icon); + QString path(link + ".desktop"); + // write file - file.setFileName(link); + file.setFileName(path); if (!file.open(QFile::WriteOnly)) return false;