forked from qt-creator/qt-creator
Git: Prevent tracking tags
Change-Id: Iea935aa226b70de936653b7637b4b9bb5e9c64cf Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
11e7c706be
commit
57a6f04ce6
@@ -77,6 +77,18 @@ public:
|
||||
return children.isEmpty();
|
||||
}
|
||||
|
||||
bool isTag() const
|
||||
{
|
||||
if (!parent)
|
||||
return false;
|
||||
for (const BranchNode *p = this; p->parent; p = p->parent) {
|
||||
// find root child with name "tags"
|
||||
if (!p->parent->parent && p->name == QLatin1String("tags"))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool childOf(BranchNode *node) const
|
||||
{
|
||||
if (this == node)
|
||||
@@ -435,6 +447,13 @@ bool BranchModel::isLeaf(const QModelIndex &idx) const
|
||||
return node->isLeaf();
|
||||
}
|
||||
|
||||
bool BranchModel::isTag(const QModelIndex &idx) const
|
||||
{
|
||||
if (!idx.isValid())
|
||||
return false;
|
||||
return indexToNode(idx)->isTag();
|
||||
}
|
||||
|
||||
void BranchModel::removeBranch(const QModelIndex &idx)
|
||||
{
|
||||
QString branch = branchName(idx);
|
||||
|
||||
Reference in New Issue
Block a user