summaryrefslogtreecommitdiff
path: root/src/plugins/git/branchmodel.cpp
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2020-05-27 18:59:53 +0200
committerTim Jenssen <tim.jenssen@qt.io>2020-05-27 18:59:53 +0200
commitb193892fd1289bd8a995cd609ead33f925b75ee1 (patch)
tree4d03bf8ea45a9ab542eb6ab129e56a82b860e19c /src/plugins/git/branchmodel.cpp
parentaa79d30b83fc79e8e18af4da0062ddf21fcd201f (diff)
parent13ad8163080153cb5d1ea39238069b5cca8f9651 (diff)
downloadqt-creator-qds-1.50.tar.gz
Merge remote-tracking branch 'origin/4.12' into qds-1.50qds-1.50
Change-Id: I8e4155aa2a0a8c7f7405dd79e856380011e23a33
Diffstat (limited to 'src/plugins/git/branchmodel.cpp')
-rw-r--r--src/plugins/git/branchmodel.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp
index 0a40144948..73c7ce5ba8 100644
--- a/src/plugins/git/branchmodel.cpp
+++ b/src/plugins/git/branchmodel.cpp
@@ -150,6 +150,11 @@ public:
return fn;
}
+ QString fullRef(bool includePrefix = false) const
+ {
+ return fullName(includePrefix).join('/');
+ }
+
void insert(const QStringList &path, BranchNode *n)
{
BranchNode *current = this;
@@ -186,7 +191,7 @@ public:
}
return names;
}
- return {fullName().join('/')};
+ return {fullRef()};
}
int rowOf(BranchNode *node)
@@ -346,7 +351,7 @@ QVariant BranchModel::data(const QModelIndex &index, int role) const
return res;
}
case Qt::EditRole:
- return index.column() == 0 ? node->fullName().join('/') : QVariant();
+ return index.column() == 0 ? node->fullRef() : QVariant();
case Qt::ToolTipRole:
if (!node->isLeaf())
return QVariant();
@@ -381,7 +386,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
if (newName.isEmpty())
return false;
- const QString oldName = node->fullName().join('/');
+ const QString oldName = node->fullRef();
if (oldName == newName)
return false;
@@ -525,7 +530,7 @@ QString BranchModel::fullName(const QModelIndex &idx, bool includePrefix) const
return QString();
if (node == d->headNode)
return QString("HEAD");
- return node->fullName(includePrefix).join('/');
+ return node->fullRef(includePrefix);
}
QStringList BranchModel::localBranchNames() const
@@ -901,7 +906,8 @@ void BranchModel::updateUpstreamStatus(BranchNode *node)
{
if (node->tracking.isEmpty())
return;
- VcsCommand *command = d->client->asyncUpstreamStatus(d->workingDirectory, node->name, node->tracking);
+ VcsCommand *command = d->client->asyncUpstreamStatus(
+ d->workingDirectory, node->fullRef(), node->tracking);
QObject::connect(command, &VcsCommand::stdOutText, node, [this, node](const QString &text) {
const QStringList split = text.trimmed().split('\t');
QTC_ASSERT(split.size() == 2, return);