GUI: handle 'cancel' in open dialog

This commit is contained in:
Daniel Marjamäki 2017-07-27 16:10:30 +02:00
parent ca2f59a6d4
commit f316e0d572
1 changed files with 4 additions and 3 deletions

View File

@ -190,9 +190,10 @@ void ProjectFileDialog::BrowseImportProject()
const QFileInfo inf(mFilePath);
const QDir &dir = inf.absoluteDir();
QString fileName = QFileDialog::getOpenFileName(this, tr("Import Project"),
dir.canonicalPath(),
tr("Visual Studio (*.sln *.vcxproj);;Compile database (compile_database.json)"));
mUI.mEditImportProject->setText(dir.relativeFilePath(fileName));
dir.canonicalPath(),
tr("Visual Studio (*.sln *.vcxproj);;Compile database (compile_database.json)"));
if (!fileName.isEmpty())
mUI.mEditImportProject->setText(dir.relativeFilePath(fileName));
}
void ProjectFileDialog::AddIncludeDir(const QString &dir)