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

Method checkInstancePathForProblems

launcher/ui/MainWindow.cpp:1718–1749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718void MainWindow::checkInstancePathForProblems()
1719{
1720 QString instanceFolder = APPLICATION->settings()->get("InstanceDir").toString();
1721 if (FS::checkProblemticPathJava(QDir(instanceFolder))) {
1722 QMessageBox warning(this);
1723 warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!"));
1724 warning.setInformativeText(tr("You have now two options: <br/>"
1725 " - change the instance folder in the settings <br/>"
1726 " - move this installation of %1 to a different folder")
1727 .arg(BuildConfig.LAUNCHER_DISPLAYNAME));
1728 warning.setDefaultButton(QMessageBox::Ok);
1729 warning.exec();
1730 }
1731 auto tempFolderText =
1732 tr("This is a problem: <br/>"
1733 " - The launcher will likely be deleted without warning by the operating system <br/>"
1734 " - close the launcher now and extract it to a real location, not a temporary folder");
1735 QString pathfoldername = QDir(instanceFolder).absolutePath();
1736 if (pathfoldername.contains("Rar$", Qt::CaseInsensitive)) {
1737 QMessageBox warning(this);
1738 warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!"));
1739 warning.setInformativeText(tempFolderText);
1740 warning.setDefaultButton(QMessageBox::Ok);
1741 warning.exec();
1742 } else if (pathfoldername.startsWith(QDir::tempPath()) || pathfoldername.contains("/TempState/")) {
1743 QMessageBox warning(this);
1744 warning.setText(tr("Your instance folder is in a temporary folder: \'%1\'!").arg(QDir::tempPath()));
1745 warning.setInformativeText(tempFolderText);
1746 warning.setDefaultButton(QMessageBox::Ok);
1747 warning.exec();
1748 }
1749}
1750
1751void MainWindow::updateStatusCenter()
1752{

Callers 1

showMainWindowMethod · 0.80

Calls 8

checkProblemticPathJavaFunction · 0.85
QDirClass · 0.50
toStringMethod · 0.45
getMethod · 0.45
settingsMethod · 0.45
setTextMethod · 0.45
execMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected