MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / onJavaBrowse

Method onJavaBrowse

launcher/ui/widgets/JavaSettingsWidget.cpp:259–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void JavaSettingsWidget::onJavaBrowse()
260{
261 QString rawPath = QFileDialog::getOpenFileName(this, tr("Find Java executable"));
262
263 // do not allow current dir - it's dirty. Do not allow dirs that don't exist
264 if (rawPath.isEmpty()) {
265 return;
266 }
267
268 QString cookedPath = FS::NormalizePath(rawPath);
269 QFileInfo javaInfo(cookedPath);
270 if (!javaInfo.exists() || !javaInfo.isExecutable()) {
271 return;
272 }
273 m_ui->javaPathTextBox->setText(cookedPath);
274}
275
276void JavaSettingsWidget::onJavaTest()
277{

Callers

nothing calls this directly

Calls 4

NormalizePathFunction · 0.85
isEmptyMethod · 0.45
existsMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected