From 092b4593f30a66382b4c04be51c0589a121b947d Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 14 Jun 2016 19:46:18 +0200 Subject: [PATCH] Changed: Remove a profile --- .../ryzom/tools/client/ryzom_installer/src/configfile.cpp | 8 +++++++- code/ryzom/tools/client/ryzom_installer/src/configfile.h | 1 + .../tools/client/ryzom_installer/src/operationdialog.cpp | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 4c1ea179c..4cb77cfff 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -313,8 +313,14 @@ int CConfigFile::addProfile(const CProfile &profile) void CConfigFile::removeProfile(int i) { m_profiles.removeAt(i); +} - // TODO: decalle all profiles and move files +void CConfigFile::removeProfile(const QString &id) +{ + for (int i = 0; i < m_profiles.size(); ++i) + { + if (m_profiles[i].id == id) removeProfile(i); + } } bool CConfigFile::has64bitsOS() diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index 7f1ea301e..2ecd3e211 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -116,6 +116,7 @@ public: void setProfile(int i, const CProfile &profile); int addProfile(const CProfile &profile); void removeProfile(int i); + void removeProfile(const QString &id); int getDefaultServerIndex() const; void setDefaultServerIndex(int index); diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 3f3a787db..0786e01e0 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -766,6 +766,9 @@ void COperationDialog::deleteComponentsProfiles() emit fail(tr("Unable to delete files for profile %1").arg(profile.name)); return; } + + // delete profile + config->removeProfile(profileId); } emit success(m_components.servers.size());