diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-09-27 12:45:07 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-09-27 12:45:07 +0200 |
commit | 9a2d203c0d95e51ea02e3e62fef6289973777e84 (patch) | |
tree | 739ef893f0b803ca29652ba1afe3b2a7132e6497 /application/MultiMC.cpp | |
parent | 79d208795c4f1fab88caa7e1684cfbb3c37fc185 (diff) | |
download | MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.gz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.lz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.tar.xz MultiMC-9a2d203c0d95e51ea02e3e62fef6289973777e84.zip |
GH-1993 swap min/max memory settings when they are the wrong way around
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r-- | application/MultiMC.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index fd004b05..feaf88a7 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -1125,8 +1125,19 @@ MainWindow* MultiMC::showMainWindow(bool minimized) * cd4 = CPU architecture */ QVariantMap customValues; - customValues["cm1"] = m_settings->get("MinMemAlloc"); - customValues["cm2"] = m_settings->get("MaxMemAlloc"); + int min = m_settings->get("MinMemAlloc").toInt(); + int max = m_settings->get("MaxMemAlloc").toInt(); + if(min < max) + { + customValues["cm1"] = min; + customValues["cm2"] = max; + } + else + { + customValues["cm1"] = max; + customValues["cm2"] = min; + } + constexpr uint64_t Mega = 1024ull * 1024ull; int ramSize = int(Sys::getSystemRam() / Mega); qDebug() << "RAM size is" << ramSize << "MB"; |