logic: fix crash when project directory contains non-latin character (issue #899) (#901)

* added "isValid()" to FilePath
* used "isValid" in check of selected project directory
This commit is contained in:
Malte Langkabel
2020-01-27 21:52:05 +01:00
committed by GitHub
parent 719591a247
commit 8cc4aaf6ea
3 changed files with 63 additions and 5 deletions
@@ -109,11 +109,30 @@ bool QtProjectWizardContentProjectData::check()
std::vector<FilePath> paths =
FilePath(m_projectFileLocation->getText().toStdWString()).expandEnvironmentVariables();
if (paths.size() != 1 || !paths[0].isAbsolute())
if (paths.size() != 1)
{
QMessageBox msgBox;
msgBox.setText(
"The specified location is invalid. Please enter an absolute directory path.");
"The specified location seems to be invalid. Please make sure that the used "
"environment variables are unambiguous.");
msgBox.exec();
return false;
}
else if (!paths.front().isAbsolute())
{
QMessageBox msgBox;
msgBox.setText(
"The specified location seems to be invalid. Please specify an absolute directory "
"path.");
msgBox.exec();
return false;
}
else if (!paths.front().isValid())
{
QMessageBox msgBox;
msgBox.setText(
"The specified location seems to be invalid. Please check the characters used in the "
"path.");
msgBox.exec();
return false;
}