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

Method checkInstancePathForProblems

launcher/ui/MainWindow.cpp:1912–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1910}
1911
1912void MainWindow::checkInstancePathForProblems()
1913{
1914 QString instanceFolder = APPLICATION->settings()->get("InstanceDir").toString();
1915 if (FS::checkProblemticPathJava(QDir(instanceFolder)))
1916 {
1917 QMessageBox warning(this);
1918 warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!"));
1919 warning.setInformativeText(
1920 tr(
1921 "You have now two options: <br/>"
1922 " - change the instance folder in the settings <br/>"
1923 " - move this installation of %1 to a different folder"
1924 ).arg(BuildConfig.LAUNCHER_NAME)
1925 );
1926 warning.setDefaultButton(QMessageBox::Ok);
1927 warning.exec();
1928 }
1929 auto tempFolderText = tr("This is a problem: <br/>"
1930 " - The launcher will likely be deleted without warning by the operating system <br/>"
1931 " - close the launcher now and extract it to a real location, not a temporary folder");
1932 QString pathfoldername = QDir(instanceFolder).absolutePath();
1933 if (pathfoldername.contains("Rar$", Qt::CaseInsensitive))
1934 {
1935 QMessageBox warning(this);
1936 warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!"));
1937 warning.setInformativeText(tempFolderText);
1938 warning.setDefaultButton(QMessageBox::Ok);
1939 warning.exec();
1940 }
1941 else if (pathfoldername.startsWith(QDir::tempPath()) || pathfoldername.contains("/TempState/"))
1942 {
1943 QMessageBox warning(this);
1944 warning.setText(tr("Your instance folder is in a temporary folder: \'%1\'!").arg(QDir::tempPath()));
1945 warning.setInformativeText(tempFolderText);
1946 warning.setDefaultButton(QMessageBox::Ok);
1947 warning.exec();
1948 }
1949}
1950
1951void MainWindow::updateStatusCenter()
1952{

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