GUI: Avoid path concatenation when path is absolute (#1103)

When using an absolute path for import project, prepending the current
directory results in an invalid path and the analysis (silently, no
error shown in the GUI) fails.
This commit is contained in:
Sebastian 2018-03-06 22:50:16 +01:00 committed by Daniel Marjamäki
parent 857da29967
commit 6b45be6c94
1 changed files with 8 additions and 1 deletions

View File

@ -1462,7 +1462,14 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile)
if (!projectFile->getImportProject().isEmpty()) { if (!projectFile->getImportProject().isEmpty()) {
ImportProject p; ImportProject p;
QString prjfile = inf.canonicalPath() + '/' + projectFile->getImportProject(); QString prjfile;
if(QFileInfo(projectFile->getImportProject()).isAbsolute()) {
prjfile = projectFile->getImportProject();
}
else {
prjfile = inf.canonicalPath() + '/' + projectFile->getImportProject();
}
try { try {
p.import(prjfile.toStdString()); p.import(prjfile.toStdString());
} catch (InternalError &e) { } catch (InternalError &e) {