diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-12-26 17:48:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-26 17:48:43 +0100 |
commit | 6ea1234a3bb9787a77680ff528f21bdf1e40989c (patch) | |
tree | 1385918c5819df035dd5bd7b8f6bab7fc534c396 /launcher/minecraft/mod/Resource.cpp | |
parent | dd3848d7b161e415c34c3c1c393985b644a88f1c (diff) | |
parent | 434f639b0c9af355703d6c64cfe5bbe9a28d0b9b (diff) | |
download | PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.tar.gz PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.tar.bz2 PrismLauncher-6ea1234a3bb9787a77680ff528f21bdf1e40989c.zip |
Merge pull request #618 from TheKodeToad/safer-destructive-actions
Fixes https://github.com/PolyMC/PolyMC/issues/948
Diffstat (limited to 'launcher/minecraft/mod/Resource.cpp')
-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()); } |