MCPcopy Create free account
hub / github.com/MultiMC/Launcher / checkJVMArgs

Method checkJVMArgs

launcher/JavaCommon.cpp:5–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <MMCStrings.h>
4
5bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
6{
7 if (jvmargs.contains("-XX:PermSize=") || jvmargs.contains(QRegExp("-Xm[sx]"))
8 || jvmargs.contains("-XX-MaxHeapSize") || jvmargs.contains("-XX:InitialHeapSize"))
9 {
10 auto warnStr = QObject::tr(
11 "You tried to manually set a JVM memory option (using \"-XX:PermSize\", \"-XX-MaxHeapSize\", \"-XX:InitialHeapSize\", \"-Xmx\" or \"-Xms\").\n"
12 "There are dedicated boxes for these in the settings (Java tab, in the Memory group at the top).\n"
13 "This message will be displayed until you remove them from the JVM arguments.");
14 CustomMessageBox::selectable(
15 parent, QObject::tr("JVM arguments warning"),
16 warnStr,
17 QMessageBox::Warning)->exec();
18 return false;
19 }
20 return true;
21}
22
23void JavaCommon::javaWasOk(QWidget *parent, JavaCheckResult result)
24{

Callers

nothing calls this directly

Calls 3

selectableFunction · 0.85
containsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected