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

Method checkInstancePathForProblems

launcher/ui/MainWindow.cpp:1948–1985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1946}
1947
1948void MainWindow::checkInstancePathForProblems()
1949{
1950 QString instanceFolder = APPLICATION->settings()->get("InstanceDir").toString();
1951 if (FS::checkProblemticPathJava(QDir(instanceFolder)))
1952 {
1953 QMessageBox warning(this);
1954 warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!"));
1955 warning.setInformativeText(
1956 tr(
1957 "You have now two options: <br/>"
1958 " - change the instance folder in the settings <br/>"
1959 " - move this installation of %1 to a different folder"
1960 ).arg(BuildConfig.LAUNCHER_NAME)
1961 );
1962 warning.setDefaultButton(QMessageBox::Ok);
1963 warning.exec();
1964 }
1965 auto tempFolderText = tr("This is a problem: <br/>"
1966 " - The launcher will likely be deleted without warning by the operating system <br/>"
1967 " - close the launcher now and extract it to a real location, not a temporary folder");
1968 QString pathfoldername = QDir(instanceFolder).absolutePath();
1969 if (pathfoldername.contains("Rar$", Qt::CaseInsensitive))
1970 {
1971 QMessageBox warning(this);
1972 warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!"));
1973 warning.setInformativeText(tempFolderText);
1974 warning.setDefaultButton(QMessageBox::Ok);
1975 warning.exec();
1976 }
1977 else if (pathfoldername.startsWith(QDir::tempPath()) || pathfoldername.contains("/TempState/"))
1978 {
1979 QMessageBox warning(this);
1980 warning.setText(tr("Your instance folder is in a temporary folder: \'%1\'!").arg(QDir::tempPath()));
1981 warning.setInformativeText(tempFolderText);
1982 warning.setDefaultButton(QMessageBox::Ok);
1983 warning.exec();
1984 }
1985}
1986
1987void MainWindow::updateStatusCenter()
1988{

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