summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-02-09 00:54:17 +0100
committerPetr Mrázek <peterix@gmail.com>2018-02-09 00:54:17 +0100
commitb3fb437f8eea77b1b6210d22aa247138eb14dac6 (patch)
tree9f40971d2479a7f7c515e31b7d9aede11d1e94ef /api/logic
parentf115bdf5b89b2d3890102ad6b8acc3ba659ebe2b (diff)
downloadMultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar
MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.gz
MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.lz
MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.tar.xz
MultiMC-b3fb437f8eea77b1b6210d22aa247138eb14dac6.zip
NOISSUE When changing version of or installing a package, remove customized version
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/minecraft/ComponentList.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/api/logic/minecraft/ComponentList.cpp b/api/logic/minecraft/ComponentList.cpp
index dc7f3614..43ab3de8 100644
--- a/api/logic/minecraft/ComponentList.cpp
+++ b/api/logic/minecraft/ComponentList.cpp
@@ -1172,10 +1172,15 @@ bool ComponentList::setComponentVersion(const QString& uid, const QString& versi
auto iter = d->componentIndex.find(uid);
if(iter != d->componentIndex.end())
{
+ ComponentPtr component = *iter;
// set existing
- (*iter)->setVersion(version);
- (*iter)->setImportant(important);
- return true;
+ if(component->revert())
+ {
+ component->setVersion(version);
+ component->setImportant(important);
+ return true;
+ }
+ return false;
}
else
{