forked from qt-creator/qt-creator
Fix GenericProjectNode filePath, fixes the Add New wizard default path
Merge-request: 736 Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
This commit is contained in:
committed by
Thorbjørn Lindeijer
parent
375d81166c
commit
79e2108687
@@ -39,7 +39,7 @@ using namespace GenericProjectManager;
|
||||
using namespace GenericProjectManager::Internal;
|
||||
|
||||
GenericProjectNode::GenericProjectNode(GenericProject *project, Core::IFile *projectFile)
|
||||
: ProjectExplorer::ProjectNode(QFileInfo(projectFile->fileName()).absolutePath()),
|
||||
: ProjectExplorer::ProjectNode(projectFile->fileName()),
|
||||
m_project(project),
|
||||
m_projectFile(projectFile)
|
||||
{
|
||||
@@ -95,10 +95,11 @@ void GenericProjectNode::refresh()
|
||||
QFileInfo fileInfo(absoluteFileName);
|
||||
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.
|
||||
|
||||
const QString relativeFilePath = absoluteFilePath.mid(path().length() + 1);
|
||||
const QString relativeFilePath = absoluteFilePath.mid(baseDir.length() + 1);
|
||||
|
||||
if (! filePaths.contains(relativeFilePath))
|
||||
filePaths.append(relativeFilePath);
|
||||
|
||||
Reference in New Issue
Block a user