mark files as duplicate

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-06-14 22:45:15 +03:00
parent 2d51008304
commit d2510b851b
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
5 changed files with 49 additions and 16 deletions

View file

@ -161,10 +161,13 @@ bool Resource::enable(EnableAction action)
path.chop(9);
} else {
path += ".disabled";
auto newFilePath = FS::getUniqueResourceName(path);
if (newFilePath != path) {
FS::move(path, newFilePath);
}
}
if (QFileInfo::exists(path)) { // the path exists so just remove the file at path
if (!QFile::remove(path))
return false;
return false;
}
if (!file.rename(path))
return false;