diff options
author | Robert Loehning <robert.loehning@nokia.com> | 2010-08-26 18:42:07 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@nokia.com> | 2010-08-27 15:52:16 +0200 |
commit | 0d187323471237556f603ec8743207c986ea7de2 (patch) | |
tree | 35821de3b645bea0b7aebd63017f88b4b2c28c35 /src/plugins/git/branchmodel.cpp | |
parent | ce24dfa378cca1f09d944fe1d50ae1f73ac0df7f (diff) | |
download | qt-creator-0d187323471237556f603ec8743207c986ea7de2.tar.gz |
VCS[git]: Do not show pseudo branch "(no branch)"
Diffstat (limited to 'src/plugins/git/branchmodel.cpp')
-rw-r--r-- | src/plugins/git/branchmodel.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 24ea0684c5..6c7dd789e8 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -40,8 +40,7 @@ enum { debug = 0 }; namespace Git { namespace Internal { -// Parse a branch line: " *name sha description". Return true if it is -// the current one +// Parse a branch line: " *name sha description". bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent) { if (debug) @@ -53,12 +52,10 @@ bool RemoteBranchModel::Branch::parse(const QString &lineIn, bool *isCurrent) const QString branchInfo = lineIn.mid(2); QStringList tokens; - if (*isCurrent && branchInfo.startsWith(QLatin1String("(no branch)"))) { - tokens += tr("(no branch)"); - tokens += branchInfo.mid(11).split(QLatin1Char(' '), QString::SkipEmptyParts); - } else { + if (*isCurrent && branchInfo.startsWith(QLatin1String("(no branch)"))) + return false; + else tokens = branchInfo.split(QLatin1Char(' '), QString::SkipEmptyParts); - } if (tokens.size() < 2) return false; name = tokens.at(0); |