Skip to content
Snippets Groups Projects
Commit 3b045e8d authored by sanketmarkan's avatar sanketmarkan Committed by Hugo Beauzée-Luyssen
Browse files

project name should not contain special characters


problems may exist for instance adding / to project name make half of name a directory

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent cb4c1cc8
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,7 @@ GeneralPage::validatePage()
if ( m_valid == false )
return false;
const QString &defaultProjectName = Project::unNamedProject;
QString invalid_char = "/?:*\\|";
if ( ui.lineEditName->text().isEmpty() ||
ui.lineEditName->text() == defaultProjectName )
{
......@@ -95,6 +96,14 @@ GeneralPage::validatePage()
ui.lineEditName->setFocus();
return false;
}
for ( int i = 0; i < invalid_char.length() ; ++i )
if ( ui.lineEditName->text().contains( invalid_char[i] ) )
{
QMessageBox::information( this, tr( "Invalid project name" ),
tr( "Special characters are not allowed" ) );
ui.lineEditName->setFocus();
return false;
}
//Create the project directory in the workspace dir.
QString projectPath = ui.lineEditName->text().replace( ' ', '_' );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment