diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2022-12-14 15:02:04 +0000 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2022-12-14 15:20:42 +0000 |
commit | 127b094c4158f7a2315bb35cea05f5644a0db1c5 (patch) | |
tree | 5ab2b81990ab14e663922c9540182e2ae0904f4d /launcher/minecraft/mod | |
parent | e05ccc0e55488837eb8f6f88354a2f8a90ce2474 (diff) | |
download | PrismLauncher-127b094c4158f7a2315bb35cea05f5644a0db1c5.tar.gz PrismLauncher-127b094c4158f7a2315bb35cea05f5644a0db1c5.tar.bz2 PrismLauncher-127b094c4158f7a2315bb35cea05f5644a0db1c5.zip |
Improve handling of destructive actions
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/minecraft/mod')
-rw-r--r-- | launcher/minecraft/mod/Resource.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/Resource.cpp b/launcher/minecraft/mod/Resource.cpp index 0fbcfd7c..7c572d92 100644 --- a/launcher/minecraft/mod/Resource.cpp +++ b/launcher/minecraft/mod/Resource.cpp @@ -143,5 +143,9 @@ bool Resource::enable(EnableAction action) bool Resource::destroy() { m_type = ResourceType::UNKNOWN; + + if (FS::trash(m_file_info.filePath())) + return true; + return FS::deletePath(m_file_info.filePath()); } |