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/World.cpp | |
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/World.cpp')
-rw-r--r-- | launcher/minecraft/World.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/launcher/minecraft/World.cpp b/launcher/minecraft/World.cpp index 90fcf337..d310f8b9 100644 --- a/launcher/minecraft/World.cpp +++ b/launcher/minecraft/World.cpp @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> + * Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -545,6 +546,10 @@ bool World::replace(World &with) bool World::destroy() { if(!is_valid) return false; + + if (FS::trash(m_containerFile.filePath())) + return true; + if (m_containerFile.isDir()) { QDir d(m_containerFile.filePath()); |