From 44d3f75cc90321722e90d4928919773f4196ac91 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 16 May 2016 14:58:50 +0200 Subject: [PATCH] Changed: Update progress in CFilesCleaner --HG-- branch : develop --- .../client/ryzom_installer/src/filescleaner.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp index 9505d3add..e1481fcf9 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp @@ -52,6 +52,8 @@ void CFilesCleaner::setDirectory(const QString &src) bool CFilesCleaner::exec() { + if (m_listener) m_listener->operationPrepare(); + QDir dir(m_directory); // directory doesn't exist @@ -62,9 +64,21 @@ bool CFilesCleaner::exec() // temporary files QStringList files = dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files); + if (m_listener) + { + m_listener->operationInit(0, files.size()); + m_listener->operationStart(); + } + + int filesCount = 0; + foreach(const QString &file, files) { dir.remove(file); + + if (m_listener) m_listener->operationProgress(filesCount, file); + + ++filesCount; } // fonts directory is not needed anymore