forked from qt-creator/qt-creator
Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -171,7 +171,7 @@ public:
|
||||
}
|
||||
return names;
|
||||
}
|
||||
return QStringList(fullName().join(QString(QLatin1Char('/'))));
|
||||
return QStringList(fullName().join(QLatin1Char('/')));
|
||||
}
|
||||
|
||||
int rowOf(BranchNode *node)
|
||||
@@ -438,7 +438,7 @@ QString BranchModel::fullName(const QModelIndex &idx, bool includePrefix) const
|
||||
if (!node || !node->isLeaf())
|
||||
return QString();
|
||||
QStringList path = node->fullName(includePrefix);
|
||||
return path.join(QString(QLatin1Char('/')));
|
||||
return path.join(QLatin1Char('/'));
|
||||
}
|
||||
|
||||
QStringList BranchModel::localBranchNames() const
|
||||
|
||||
@@ -132,7 +132,7 @@ void GerritParameters::toSettings(QSettings *s) const
|
||||
void GerritParameters::saveQueries(QSettings *s) const
|
||||
{
|
||||
s->beginGroup(QLatin1String(settingsGroupC));
|
||||
s->setValue(QLatin1String(savedQueriesKeyC), savedQueries.join(QLatin1String(",")));
|
||||
s->setValue(QLatin1String(savedQueriesKeyC), savedQueries.join(QLatin1Char(',')));
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ void GerritPlugin::push(const QString &topLevel)
|
||||
options << QLatin1String("r=") + reviewer;
|
||||
|
||||
if (!options.isEmpty())
|
||||
target += QLatin1Char('%') + options.join(QLatin1String(","));
|
||||
target += QLatin1Char('%') + options.join(QLatin1Char(','));
|
||||
|
||||
args << target;
|
||||
|
||||
|
||||
@@ -727,7 +727,7 @@ static inline void msgCannotRun(const QStringList &args, const QString &workingD
|
||||
const QByteArray &error, QString *errorMessage)
|
||||
{
|
||||
const QString message = GitClient::tr("Cannot run \"%1 %2\" in \"%2\": %3")
|
||||
.arg(QLatin1String("git ") + args.join(QLatin1String(" ")),
|
||||
.arg(QLatin1String("git ") + args.join(QLatin1Char(' ')),
|
||||
QDir::toNativeSeparators(workingDirectory),
|
||||
commandOutputFromLocal8Bit(error));
|
||||
|
||||
@@ -3220,7 +3220,7 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
|
||||
if (!commit.isEmpty())
|
||||
message = tr("Conflicts detected with commit %1.").arg(commit);
|
||||
else if (!files.isEmpty())
|
||||
message = tr("Conflicts detected with files:\n%1").arg(files.join(QLatin1String("\n")));
|
||||
message = tr("Conflicts detected with files:\n%1").arg(files.join(QLatin1Char('\n')));
|
||||
else
|
||||
message = tr("Conflicts detected.");
|
||||
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message,
|
||||
|
||||
@@ -208,7 +208,7 @@ void StashDialog::deleteSelection()
|
||||
errors.push_back(errorMessage);
|
||||
refresh(m_repository, true);
|
||||
if (!errors.isEmpty())
|
||||
warning(title, errors.join(QString(QLatin1Char('\n'))));
|
||||
warning(title, errors.join(QLatin1Char('\n')));
|
||||
}
|
||||
|
||||
void StashDialog::showCurrent()
|
||||
|
||||
Reference in New Issue
Block a user