do not double rename

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-06-14 22:46:39 +03:00
parent d2510b851b
commit b872f88617
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -161,10 +161,7 @@ bool Resource::enable(EnableAction action)
path.chop(9); path.chop(9);
} else { } else {
path += ".disabled"; path += ".disabled";
auto newFilePath = FS::getUniqueResourceName(path); path = 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 (QFileInfo::exists(path)) { // the path exists so just remove the file at path
return false; return false;