skip QSaveFile temprary files
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QSaveFile>
|
||||
#include <QString>
|
||||
|
||||
#include <FileSystem.h>
|
||||
@@ -57,6 +56,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "PSaveFile.h"
|
||||
|
||||
using std::nullopt;
|
||||
using std::optional;
|
||||
@@ -183,7 +183,7 @@ bool putLevelDatDataToFS(const QFileInfo& file, QByteArray& data)
|
||||
if (fullFilePath.isNull()) {
|
||||
return false;
|
||||
}
|
||||
QSaveFile f(fullFilePath);
|
||||
PSaveFile f(fullFilePath);
|
||||
if (!f.open(QIODevice::WriteOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "ModFolderLoadTask.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "FileSystem.h"
|
||||
#include "minecraft/mod/MetadataHandler.h"
|
||||
|
||||
@@ -65,6 +66,9 @@ void ModFolderLoadTask::executeTask()
|
||||
m_mods_dir.refresh();
|
||||
for (auto entry : m_mods_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);
|
||||
|
||||
Reference in New Issue
Block a user