skip QSaveFile temprary files

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-10-21 23:53:23 +03:00
parent b049e92697
commit 562c301326
13 changed files with 129 additions and 23 deletions

View File

@ -7,6 +7,7 @@
#include <memory>
#include "Application.h"
#include "FileSystem.h"
#include "minecraft/mod/Resource.h"
@ -52,6 +53,9 @@ class BasicFolderLoadTask : public Task {
m_dir.refresh();
for (auto entry : m_dir.entryInfoList()) {
auto filePath = entry.absoluteFilePath();
if (auto app = APPLICATION_DYN; app && app->checkQSavePath(filePath)) {
continue;
}
auto newFilePath = FS::getUniqueResourceName(filePath);
if (newFilePath != filePath) {
FS::move(filePath, newFilePath);