forked from qt-creator/qt-creator
Git: De-noise
* Remove QLatin1{String|Char} where possible
* Use initializer lists for QStringList
Change-Id: I8479f87f4fc909b5d74d854956885564209538e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
539e33da02
commit
516161c875
@@ -39,16 +39,16 @@ void BranchComboBox::init(const QString &repository)
|
||||
QString currentBranch = GitPlugin::client()->synchronousCurrentLocalBranch(repository);
|
||||
if (currentBranch.isEmpty()) {
|
||||
m_detached = true;
|
||||
currentBranch = QLatin1String("HEAD");
|
||||
currentBranch = "HEAD";
|
||||
addItem(currentBranch);
|
||||
}
|
||||
QString output;
|
||||
const QString branchPrefix(QLatin1String("refs/heads/"));
|
||||
QStringList args;
|
||||
args << QLatin1String("--format=%(refname)") << branchPrefix;
|
||||
if (!GitPlugin::client()->synchronousForEachRefCmd(m_repository, args, &output))
|
||||
const QString branchPrefix("refs/heads/");
|
||||
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
||||
m_repository, { "--format=%(refname)", branchPrefix }, &output)) {
|
||||
return;
|
||||
QStringList branches = output.trimmed().split(QLatin1Char('\n'));
|
||||
}
|
||||
QStringList branches = output.trimmed().split('\n');
|
||||
foreach (const QString &ref, branches) {
|
||||
const QString branch = ref.mid(branchPrefix.size());
|
||||
addItem(branch);
|
||||
|
||||
Reference in New Issue
Block a user