aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/Resource.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-07-16 14:18:26 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-07-16 14:18:26 +0300
commit0a956bbc732f2258866f3e07e947551dfd993be6 (patch)
tree06760fa10412fb89380c9bc7e453e4dbe0a56e42 /launcher/minecraft/mod/Resource.cpp
parent1e9a596908ba85dea974e6d041b53c675f8d7b78 (diff)
parentb9568279dc364a462e9837ea13bc3c4f61abdda8 (diff)
downloadPrismLauncher-0a956bbc732f2258866f3e07e947551dfd993be6.tar.gz
PrismLauncher-0a956bbc732f2258866f3e07e947551dfd993be6.tar.bz2
PrismLauncher-0a956bbc732f2258866f3e07e947551dfd993be6.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into catpacks
Diffstat (limited to 'launcher/minecraft/mod/Resource.cpp')
-rw-r--r--launcher/minecraft/mod/Resource.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/launcher/minecraft/mod/Resource.cpp b/launcher/minecraft/mod/Resource.cpp
index e5077260..098a617f 100644
--- a/launcher/minecraft/mod/Resource.cpp
+++ b/launcher/minecraft/mod/Resource.cpp
@@ -148,14 +148,10 @@ bool Resource::enable(EnableAction action)
return true;
}
-bool Resource::destroy()
+bool Resource::destroy(bool attemptTrash)
{
m_type = ResourceType::UNKNOWN;
-
- if (FS::trash(m_file_info.filePath()))
- return true;
-
- return FS::deletePath(m_file_info.filePath());
+ return (attemptTrash && FS::trash(m_file_info.filePath())) || FS::deletePath(m_file_info.filePath());
}
bool Resource::isSymLinkUnder(const QString& instPath) const