forked from qt-creator/qt-creator
Don't show error message if file added to qmlproject is picked up
Check for the case that a new file to be added to a .qmlproject is also automatically covered e.g. by a wildcard filter. In this case we don't have to do anything.
This commit is contained in:
@@ -115,6 +115,26 @@ QStringList QmlProjectItem::files() const
|
||||
return files;
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether the project would include a file path
|
||||
- regardless whether the file already exists or not.
|
||||
|
||||
@param filePath: absolute file path to check
|
||||
*/
|
||||
bool QmlProjectItem::matchesFile(const QString &filePath) const
|
||||
{
|
||||
const Q_D(QmlProjectItem);
|
||||
for (int i = 0; i < d->content.size(); ++i) {
|
||||
QmlProjectContentItem *contentElement = d->content.at(i);
|
||||
FileFilterBaseItem *fileFilter = qobject_cast<FileFilterBaseItem*>(contentElement);
|
||||
if (fileFilter) {
|
||||
if (fileFilter->matchesFile(filePath))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace QmlProjectManager
|
||||
|
||||
QML_DEFINE_NOCREATE_TYPE(QmlProjectManager::QmlProjectContentItem)
|
||||
|
||||
Reference in New Issue
Block a user