From d3e07084471930a502037f768ce616da7b38ec3f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 9 Oct 2016 15:09:54 +0200 Subject: [PATCH] Changed: Remove whole directory if empty --- .../client/ryzom_installer/src/operationdialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 766d7f9b0..6878adcfd 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1074,6 +1074,9 @@ void COperationDialog::deleteComponentsServers() // clear list of all servers to uninstall m_removeComponents.servers.clear(); + // delete Ryzom directory if all files have been deleted + if (isDirectoryEmpty(config->getInstallationDirectory(), true)) QDir(config->getInstallationDirectory()).removeRecursively(); + emit done(); } @@ -1144,6 +1147,9 @@ void COperationDialog::deleteComponentsProfiles() // clear list of all profiles to uninstall m_removeComponents.profiles.clear(); + // delete profiles directory if all files have been deleted + if (isDirectoryEmpty(config->getProfileDirectory(), true)) QDir(config->getProfileDirectory()).removeRecursively(); + emit done(); } @@ -1192,6 +1198,9 @@ void COperationDialog::deleteComponentsInstaller() // reset it once it's done m_removeComponents.installer = false; + // delete Ryzom directory if all files have been deleted + if (isDirectoryEmpty(config->getInstallationDirectory(), true)) QDir(config->getInstallationDirectory()).removeRecursively(); + emit success(1); emit done(); } @@ -1227,6 +1236,9 @@ void COperationDialog::deleteComponentsDownloadedFiles() // reset it once it's done m_removeComponents.downloadedFiles = false; + // delete Ryzom directory if all files have been deleted + if (isDirectoryEmpty(config->getInstallationDirectory(), true)) QDir(config->getInstallationDirectory()).removeRecursively(); + emit success(1); emit done(); }