Commit 79e21086 authored by Kevin Michel's avatar Kevin Michel Committed by Thorbjørn Lindeijer
Browse files

Fix GenericProjectNode filePath, fixes the Add New wizard default path



Merge-request: 736
Reviewed-by: default avatarThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
parent 375d8116
...@@ -39,7 +39,7 @@ using namespace GenericProjectManager; ...@@ -39,7 +39,7 @@ using namespace GenericProjectManager;
using namespace GenericProjectManager::Internal; using namespace GenericProjectManager::Internal;
GenericProjectNode::GenericProjectNode(GenericProject *project, Core::IFile *projectFile) GenericProjectNode::GenericProjectNode(GenericProject *project, Core::IFile *projectFile)
: ProjectExplorer::ProjectNode(QFileInfo(projectFile->fileName()).absolutePath()), : ProjectExplorer::ProjectNode(projectFile->fileName()),
m_project(project), m_project(project),
m_projectFile(projectFile) m_projectFile(projectFile)
{ {
...@@ -95,10 +95,11 @@ void GenericProjectNode::refresh() ...@@ -95,10 +95,11 @@ void GenericProjectNode::refresh()
QFileInfo fileInfo(absoluteFileName); QFileInfo fileInfo(absoluteFileName);
const QString absoluteFilePath = fileInfo.path(); const QString absoluteFilePath = fileInfo.path();
if (! absoluteFilePath.startsWith(path())) QString baseDir(QFileInfo(path()).absolutePath());
if (! absoluteFilePath.startsWith(baseDir))
continue; // `file' is not part of the project. continue; // `file' is not part of the project.
const QString relativeFilePath = absoluteFilePath.mid(path().length() + 1); const QString relativeFilePath = absoluteFilePath.mid(baseDir.length() + 1);
if (! filePaths.contains(relativeFilePath)) if (! filePaths.contains(relativeFilePath))
filePaths.append(relativeFilePath); filePaths.append(relativeFilePath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment