MCPcopy Create free account
hub / github.com/PrismLauncher/PrismLauncher / checkInstancePathForProblems

Method checkInstancePathForProblems

launcher/ui/MainWindow.cpp:1717–1748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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