From 334dc3cb6c1a25cbf9394ef73fac98a2fa690991 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 11 Apr 2016 09:05:11 -0700 Subject: [PATCH] cleanup left file debug, add check for deleted mapping --- assignment-client/src/assets/AssetServer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp index 00fbdf7ab7..a06163c396 100644 --- a/assignment-client/src/assets/AssetServer.cpp +++ b/assignment-client/src/assets/AssetServer.cpp @@ -151,9 +151,7 @@ void AssetServer::cleanupUnmappedFiles() { for (const auto& fileInfo : files) { if (hashFileRegex.exactMatch(fileInfo.fileName())) { - if (mappedHashes.contains(fileInfo.fileName())) { - qDebug() << "\tLeaving" << fileInfo.fileName() << "in asset files directory since it is mapped"; - } else { + if (!mappedHashes.contains(fileInfo.fileName())) { // remove the unmapped file QFile removeableFile { fileInfo.absoluteFilePath() }; @@ -578,6 +576,9 @@ bool AssetServer::deleteMappings(AssetPathList& paths) { } else { auto oldMapping = _fileMappings.take(path); if (!oldMapping.isNull()) { + // add this hash to the list we need to check for asset removal from server + hashesToCheck << oldMapping.toString(); + qDebug() << "Deleted a mapping:" << path << "=>" << oldMapping.toString(); } else { qDebug() << "Unable to delete a mapping that was not found:" << path;