From cc289e8b1ee4a25a34c11f925e8554bbed34a065 Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 5 Aug 2019 18:17:07 +0200 Subject: [PATCH] ui: hide jvm maximum memory setting on windows 10 (issue #694) setting this value to anything other than -1 will cause Sourcetrail to get stuck when initializing the JVM --- .../QtProjectWizardContentPreferences.cpp | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp index 981b49ae..c8431a83 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp @@ -315,6 +315,8 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row) m_javaPathDetector = utility::getJavaRuntimePathDetector(); addJavaPathDetection(layout, row); } + + if (QSysInfo::windowsVersion() != QSysInfo::WV_WINDOWS10) { // jvm max memory m_jvmMaximumMemory = addLineEdit( @@ -327,6 +329,11 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row) ); layout->setRowMinimumHeight(row - 1, 30); } + else + { + m_jvmMaximumMemory = nullptr; + } + { // JRE System Library const QString title = "JRE System Library"; @@ -458,7 +465,10 @@ void QtProjectWizardContentPreferences::load() m_javaPath->setText(QString::fromStdWString(appSettings->getJavaPath().wstr())); } - m_jvmMaximumMemory->setText(QString::number(appSettings->getJavaMaximumMemory())); + if (m_jvmMaximumMemory) + { + m_jvmMaximumMemory->setText(QString::number(appSettings->getJavaMaximumMemory())); + } m_jreSystemLibraryPaths->setPaths(appSettings->getJreSystemLibraryPaths()); @@ -524,8 +534,14 @@ void QtProjectWizardContentPreferences::save() appSettings->setJreSystemLibraryPaths(m_jreSystemLibraryPaths->getPathsAsAbsolute()); - int jvmMaximumMemory = m_jvmMaximumMemory->text().toInt(); - if (jvmMaximumMemory) appSettings->setJavaMaximumMemory(jvmMaximumMemory); + if (m_jvmMaximumMemory) + { + const int jvmMaximumMemory = m_jvmMaximumMemory->text().toInt(); + if (jvmMaximumMemory) + { + appSettings->setJavaMaximumMemory(jvmMaximumMemory); + } + } if (m_mavenPath) {