From a7ca5eaac2dc75028d1c63287de7495ec04f23ac Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:04:31 +0200 Subject: [PATCH] Changed: Support old and new data files --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 14 +++++++-- .../ryzom_installer/src/filescleaner.cpp | 31 ++++++++----------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 2543d03fa..47315f6ac 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -667,11 +667,21 @@ bool CConfigFile::foundTemporaryFiles(const QString &directory) const if (!dir.cd("data") && dir.exists()) return false; + QStringList filter; + filter << "*.string_cache"; + + if (dir.exists("packed_sheets.bnp")) + { + filter << "*.packed_sheets"; + filter << "*.packed"; + filter << "*.pem"; + } + // temporary files - if (!dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files).isEmpty()) return true; + if (!dir.entryList(filter, QDir::Files).isEmpty()) return true; // fonts directory is not needed anymore - if (dir.cd("fonts") && dir.exists()) return true; + if (dir.exists("fonts.bnp") && dir.cd("fonts") && dir.exists()) return true; return false; } diff --git a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp index 79c42634a..2f310e056 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp @@ -17,21 +17,6 @@ #include "stdpch.h" #include "filescleaner.h" #include "operation.h" -#include "utils.h" - -#include "nel/misc/big_file.h" -#include "nel/misc/callback.h" -#include "nel/misc/file.h" -#include "nel/misc/path.h" - -#include "7z.h" -#include "7zAlloc.h" -#include "7zBuf.h" -#include "7zCrc.h" - -#include "qzipreader.h" - -#include #ifdef DEBUG_NEW #define new DEBUG_NEW @@ -63,8 +48,18 @@ bool CFilesCleaner::exec() if (!dir.cd("data") && dir.exists()) return false; + QStringList filter; + filter << "*.string_cache"; + + if (dir.exists("packed_sheets.bnp")) + { + filter << "*.packed_sheets"; + filter << "*.packed"; + filter << "*.pem"; + } + // temporary files - QStringList files = dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files); + QStringList files = dir.entryList(filter, QDir::Files); if (m_listener) { @@ -83,8 +78,8 @@ bool CFilesCleaner::exec() ++filesCount; } - // fonts directory is not needed anymore - if (dir.cd("fonts") && dir.exists()) + // fonts directory is not needed anymore if fonts.bnp exists + if (dir.exists("fonts.bnp") && dir.cd("fonts") && dir.exists()) { dir.removeRecursively(); }