forked from qt-creator/qt-creator
Use Utils::SkipEmptyParts instead of the deprecated one in QString
- Qt 5.14 introduced Qt::Keep/SkipEmptyParts and deprecated these in QString namespace. - Qt Creator defined Utils::SkipEmptyParts conditional on the Qt version, so we use that for flexibility. - Remove any explicit references to QString::KeepEmptyParts, as it's a default value. Change-Id: I72c65e4901ebc4c5422d4835e63fe23fb6ef28ff Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
@@ -282,7 +283,7 @@ QList<BranchInfo> FossilClient::branchListFromOutput(const QString &output, cons
|
||||
// Branch list format:
|
||||
// " branch-name"
|
||||
// "* current-branch"
|
||||
return Utils::transform(output.split('\n', QString::SkipEmptyParts), [=](const QString& l) {
|
||||
return Utils::transform(output.split('\n', Utils::SkipEmptyParts), [=](const QString& l) {
|
||||
const QString &name = l.mid(2);
|
||||
QTC_ASSERT(!name.isEmpty(), return BranchInfo());
|
||||
const BranchInfo::BranchFlags flags = (l.startsWith("* ") ? defaultFlags | BranchInfo::Current : defaultFlags);
|
||||
@@ -395,7 +396,7 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
||||
const QString hashToken =
|
||||
QString::fromUtf8(supportedFeatures().testFlag(InfoHashFeature) ? "hash: " : "uuid: ");
|
||||
|
||||
for (const QString &l : output.split('\n', QString::SkipEmptyParts)) {
|
||||
for (const QString &l : output.split('\n', Utils::SkipEmptyParts)) {
|
||||
if (l.startsWith("checkout: ", Qt::CaseInsensitive)
|
||||
|| l.startsWith(hashToken, Qt::CaseInsensitive)) {
|
||||
const QRegularExpressionMatch idMatch = idRx.match(l);
|
||||
@@ -446,7 +447,7 @@ QStringList FossilClient::synchronousTagQuery(const QString &workingDirectory, c
|
||||
|
||||
const QString output = sanitizeFossilOutput(response.stdOut());
|
||||
|
||||
return output.split('\n', QString::SkipEmptyParts);
|
||||
return output.split('\n', Utils::SkipEmptyParts);
|
||||
}
|
||||
|
||||
RepositorySettings FossilClient::synchronousSettingsQuery(const QString &workingDirectory)
|
||||
@@ -468,12 +469,12 @@ RepositorySettings FossilClient::synchronousSettingsQuery(const QString &working
|
||||
|
||||
const QString output = sanitizeFossilOutput(response.stdOut());
|
||||
|
||||
for (const QString &line : output.split('\n', QString::SkipEmptyParts)) {
|
||||
for (const QString &line : output.split('\n', Utils::SkipEmptyParts)) {
|
||||
// parse settings line:
|
||||
// <property> <(local|global)> <value>
|
||||
// Fossil properties are case-insensitive; force them to lower-case.
|
||||
// Values may be in mixed-case; force lower-case for fixed values.
|
||||
const QStringList fields = line.split(' ', QString::SkipEmptyParts);
|
||||
const QStringList fields = line.split(' ', Utils::SkipEmptyParts);
|
||||
|
||||
const QString property = fields.at(0).toLower();
|
||||
const QString value = (fields.size() >= 3 ? fields.at(2) : QString());
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <utils/completingtextedit.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
#include <QTextEdit>
|
||||
@@ -122,7 +123,7 @@ QStringList FossilCommitWidget::tags() const
|
||||
return QStringList();
|
||||
|
||||
tagsText.replace(',', ' ');
|
||||
const QStringList tags = tagsText.split(' ', QString::SkipEmptyParts);
|
||||
const QStringList tags = tagsText.split(' ', Utils::SkipEmptyParts);
|
||||
return tags;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
|
||||
#include <utils/parameteraction.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
@@ -834,7 +835,7 @@ bool FossilPluginPrivate::submitEditorAboutToClose()
|
||||
//rewrite entries of the form 'file => newfile' to 'newfile' because
|
||||
//this would mess the commit command
|
||||
for (QStringList::iterator iFile = files.begin(); iFile != files.end(); ++iFile) {
|
||||
const QStringList parts = iFile->split(" => ", QString::SkipEmptyParts);
|
||||
const QStringList parts = iFile->split(" => ", Utils::SkipEmptyParts);
|
||||
if (!parts.isEmpty())
|
||||
*iFile = parts.last();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void FossilJsExtension::parseArgOptions(const QStringList &args, QMap<QString, Q
|
||||
foreach (const QString &arg, args) {
|
||||
if (arg.isEmpty()) continue;
|
||||
|
||||
QStringList opt = arg.split('|', QString::KeepEmptyParts);
|
||||
QStringList opt = arg.split('|'); //keep empty parts
|
||||
options.insert(opt[0], opt.size() > 1 ? opt[1] : QString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user