Prevented project's existing .pro file from being added to project

A project's existing .pro file could be added to the project, making
the .pro file appear twice in the project tree. This is sub-optimal
because

1. It does not make sense for the .pro file to appear twice.
2. Qt Creator crashes when trying to remove either of the duplicate
.pro files.
This commit is contained in:
Stian Sandvik Thomassen
2009-07-09 14:51:56 +10:00
parent d991ea2364
commit 9ebba84bfe

View File

@@ -391,7 +391,10 @@ void Qt4PriFileNode::changeFiles(const FileType fileType,
}
const QModelIndex varIndex = root.child(row, 0);
const QString &proFilePath = includeFile->fileName();
foreach (const QString &filePath, filePaths) {
if (filePath == proFilePath)
continue;
const QString &relativeFilePath = priFileDir.relativeFilePath(filePath);
proModel.insertItem(new ProValue(relativeFilePath, proVar),
proModel.rowCount(varIndex), varIndex);