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:
parent
857da29967
commit
6b45be6c94
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue