From 3e9a3404d1bbee0132aa5639ed7a9e17981ecfd5 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 25 Jul 2016 18:36:03 +0200 Subject: [PATCH] Changed: Delete and create shortcuts, see #279 --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index d402476e3..060eec4e5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -234,6 +234,9 @@ void COperationDialog::updateAddRemoveComponents() // remove profiles that still exist profilesToDelete.removeAll(profile.id); + + // delete all shortcuts, they'll be recreated later + profile.deleteShortcuts(); } // update components to remove @@ -256,10 +259,9 @@ void COperationDialog::processUpdateProfilesNextStep() { updateAddRemoveComponents(); } + // TODO: check all servers are downloaded // TODO: delete profiles directories that are not used anymore - // TODO: create shortcuts - if (!m_removeComponents.profiles.isEmpty()) { @@ -275,9 +277,10 @@ void COperationDialog::processUpdateProfilesNextStep() return; } + CConfigFile *config = CConfigFile::getInstance(); + if (!m_addComponents.servers.isEmpty()) { - CConfigFile *config = CConfigFile::getInstance(); const CServer &defaultServer = config->getServer(); // servers files to download/update @@ -334,6 +337,12 @@ void COperationDialog::processUpdateProfilesNextStep() } } + // recreate shortcuts + foreach(const CProfile &profile, config->getProfiles()) + { + profile.createShortcuts(); + } + updateAddRemoveEntry(); } @@ -1010,6 +1019,17 @@ void COperationDialog::deleteComponentsServers() return; } } + + // delete all links to clients + for (int i = 0; i < config->getProfilesCount(); ++i) + { + const CProfile &profile = config->getProfile(i); + + if (profile.server == serverId) + { + profile.deleteShortcuts(); + } + } } emit success(m_removeComponents.servers.size()); @@ -1072,7 +1092,7 @@ void COperationDialog::deleteComponentsProfiles() } } - // TODO: delete links + profile.deleteShortcuts(); // delete profile config->removeProfile(profileId);