MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / checkInstancePathForProblems

Method checkInstancePathForProblems

launcher/ui/MainWindow.cpp:1728–1759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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