forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user