Utils: Drop Utils::SkipEmptyParts again

We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-07-21 10:19:36 +02:00
parent c41847ce5d
commit 43b658e9e7
67 changed files with 91 additions and 91 deletions

View File

@@ -90,7 +90,7 @@ static QStringList environmentImportPaths()
QStringList paths;
const QStringList importPaths = QString::fromLocal8Bit(qgetenv("QML_IMPORT_PATH")).split(
Utils::HostOsInfo::pathListSeparator(), Utils::SkipEmptyParts);
Utils::HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
for (const QString &path : importPaths) {
const QString canonicalPath = QDir(path).canonicalPath();

View File

@@ -241,7 +241,7 @@ QString QmlJS::modulePath(const QString &name, const QString &version,
return QString();
const QString sanitizedVersion = version == undefinedVersion ? QString() : version;
const QStringList parts = name.split('.', Utils::SkipEmptyParts);
const QStringList parts = name.split('.', Qt::SkipEmptyParts);
auto mkpath = [] (const QStringList &xs) -> QString { return xs.join(QLatin1Char('/')); };
// Regular expression for building candidates by successively removing minor and major

View File

@@ -304,7 +304,7 @@ FilePaths Environment::path() const
FilePaths Environment::pathListValue(const QString &varName) const
{
const QStringList pathComponents = expandedValueForKey(varName)
.split(OsSpecificAspects::pathListSeparator(m_osType), Utils::SkipEmptyParts);
.split(OsSpecificAspects::pathListSeparator(m_osType), Qt::SkipEmptyParts);
return transform(pathComponents, &FilePath::fromUserInput);
}

View File

@@ -122,7 +122,7 @@ void FileInProjectFinder::setSysroot(const FilePath &sysroot)
void FileInProjectFinder::addMappedPath(const FilePath &localFilePath, const QString &remoteFilePath)
{
const QStringList segments = remoteFilePath.split('/', Utils::SkipEmptyParts);
const QStringList segments = remoteFilePath.split('/', Qt::SkipEmptyParts);
PathMappingNode *node = &m_pathMapRoot;
for (const QString &segment : segments) {
@@ -192,7 +192,7 @@ bool FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FileH
return false;
}
const auto segments = originalPath.splitRef('/', Utils::SkipEmptyParts);
const auto segments = originalPath.splitRef('/', Qt::SkipEmptyParts);
const PathMappingNode *node = &m_pathMapRoot;
for (const auto &segment : segments) {
auto it = node->children.find(segment.toString());

View File

@@ -166,7 +166,7 @@ QStringList PathListEditor::pathList() const
if (text.isEmpty())
return QStringList();
// trim each line
QStringList rc = text.split('\n', Utils::SkipEmptyParts);
QStringList rc = text.split('\n', Qt::SkipEmptyParts);
const QStringList::iterator end = rc.end();
for (QStringList::iterator it = rc.begin(); it != end; ++it)
*it = it->trimmed();
@@ -184,7 +184,7 @@ void PathListEditor::setPathList(const QString &pathString)
clear();
} else {
setPathList(pathString.split(HostOsInfo::pathListSeparator(),
Utils::SkipEmptyParts));
Qt::SkipEmptyParts));
}
}

View File

@@ -600,7 +600,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(const FilePath &adbTo
.arg(cmd.toUserOutput());
return devices;
}
QStringList adbDevs = response.allOutput().split('\n', Utils::SkipEmptyParts);
QStringList adbDevs = response.allOutput().split('\n', Qt::SkipEmptyParts);
if (adbDevs.empty())
return devices;

View File

@@ -146,7 +146,7 @@ bool AndroidManager::packageInstalled(const QString &deviceSerial,
QStringList args = AndroidDeviceInfo::adbSelector(deviceSerial);
args << "shell" << "pm" << "list" << "packages";
QStringList lines = runAdbCommand(args).stdOut().split(QRegularExpression("[\\n\\r]"),
Utils::SkipEmptyParts);
Qt::SkipEmptyParts);
for (const QString &line : lines) {
// Don't want to confuse com.abc.xyz with com.abc.xyz.def so check with
// endsWith

View File

@@ -510,7 +510,7 @@ void AndroidRunnerWorker::asyncStartHelper()
}
for (const QString &entry : m_beforeStartAdbCommands)
runAdb(entry.split(' ', Utils::SkipEmptyParts));
runAdb(entry.split(' ', Qt::SkipEmptyParts));
QStringList args({"shell", "am", "start"});
args << m_amStartExtraArgs;
@@ -800,7 +800,7 @@ void AndroidRunnerWorker::onProcessIdChanged(qint64 pid)
// Run adb commands after application quit.
for (const QString &entry: m_afterFinishAdbCommands)
runAdb(entry.split(' ', Utils::SkipEmptyParts));
runAdb(entry.split(' ', Qt::SkipEmptyParts));
} else {
// In debugging cases this will be funneled to the engine to actually start
// and attach gdb. Afterwards this ends up in handleRemoteDebuggerRunning() below.

View File

@@ -105,7 +105,7 @@ int parseProgress(const QString &out, bool &foundAssertion)
if (out.isEmpty())
return progress;
QRegularExpression reg("(?<progress>\\d*)%");
QStringList lines = out.split(QRegularExpression("[\\n\\r]"), Utils::SkipEmptyParts);
QStringList lines = out.split(QRegularExpression("[\\n\\r]"), Qt::SkipEmptyParts);
for (const QString &line : lines) {
QRegularExpressionMatch match = reg.match(line);
if (match.hasMatch()) {

View File

@@ -128,7 +128,7 @@ QStringList BoostTestConfiguration::argumentsForTestRunner(QStringList *omitted)
if (AutotestPlugin::settings()->processArgs) {
arguments << filterInterfering(runnable().commandLineArguments.split(
' ', Utils::SkipEmptyParts), omitted);
' ', Qt::SkipEmptyParts), omitted);
}
return arguments;
}

View File

@@ -101,7 +101,7 @@ QStringList CatchConfiguration::argumentsForTestRunner(QStringList *omitted) con
if (AutotestPlugin::settings()->processArgs) {
arguments << filterInterfering(runnable().commandLineArguments.split(
' ', Utils::SkipEmptyParts), omitted);
' ', Qt::SkipEmptyParts), omitted);
}
auto settings = dynamic_cast<CatchTestSettings *>(framework()->frameworkSettings());

View File

@@ -77,7 +77,7 @@ QStringList GTestConfiguration::argumentsForTestRunner(QStringList *omitted) con
QStringList arguments;
if (AutotestPlugin::settings()->processArgs) {
arguments << filterInterfering(runnable().commandLineArguments.split(
' ', Utils::SkipEmptyParts), omitted);
' ', Qt::SkipEmptyParts), omitted);
}
const QStringList &testSets = testCases();

View File

@@ -93,10 +93,10 @@ static bool matchesFilter(const QString &filter, const QString &fullTestName)
QStringList negative;
int startOfNegative = filter.indexOf('-');
if (startOfNegative == -1) {
positive.append(filter.split(':', Utils::SkipEmptyParts));
positive.append(filter.split(':', Qt::SkipEmptyParts));
} else {
positive.append(filter.left(startOfNegative).split(':', Utils::SkipEmptyParts));
negative.append(filter.mid(startOfNegative + 1).split(':', Utils::SkipEmptyParts));
positive.append(filter.left(startOfNegative).split(':', Qt::SkipEmptyParts));
negative.append(filter.mid(startOfNegative + 1).split(':', Qt::SkipEmptyParts));
}
QString testName = fullTestName;

View File

@@ -52,7 +52,7 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
QStringList arguments;
if (AutotestPlugin::settings()->processArgs) {
arguments.append(QTestUtils::filterInterfering(
runnable().commandLineArguments.split(' ', Utils::SkipEmptyParts),
runnable().commandLineArguments.split(' ', Qt::SkipEmptyParts),
omitted, false));
}
auto qtSettings = dynamic_cast<QtTestSettings *>(framework()->frameworkSettings());

View File

@@ -59,7 +59,7 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted)
QStringList arguments;
if (AutotestPlugin::settings()->processArgs) {
arguments.append(QTestUtils::filterInterfering
(runnable().commandLineArguments.split(' ', Utils::SkipEmptyParts),
(runnable().commandLineArguments.split(' ', Qt::SkipEmptyParts),
omitted, true));
}

View File

@@ -376,7 +376,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
// Get all values of a line separated by spaces.
// Values representing a variable like $(value) get
// removed currently.
QStringList lineValues = m_line.split(QLatin1Char(' '), Utils::SkipEmptyParts);
QStringList lineValues = m_line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
QStringList::iterator it = lineValues.begin();
while (it != lineValues.end()) {
if ((*it).startsWith(QLatin1String("$("))) {

View File

@@ -789,7 +789,7 @@ bool BazaarPluginPrivate::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(QLatin1String(" => "), Utils::SkipEmptyParts);
const QStringList parts = iFile->split(QLatin1String(" => "), Qt::SkipEmptyParts);
if (!parts.isEmpty())
*iFile = parts.last();
}

View File

@@ -205,7 +205,7 @@ void ArtisticStyleSettings::createDocumentationFile() const
for (QString line : lines) {
line = line.trimmed();
if ((line.startsWith("--") && !line.startsWith("---")) || line.startsWith("OR ")) {
const QStringList rawKeys = line.split(" OR ", Utils::SkipEmptyParts);
const QStringList rawKeys = line.split(" OR ", Qt::SkipEmptyParts);
for (QString k : rawKeys) {
k = k.trimmed();
k.remove('#');

View File

@@ -309,7 +309,7 @@ public:
propagateDown(index(0, 0, QModelIndex()));
QStringList checksList = checks.simplified().remove(" ")
.split(",", Utils::SkipEmptyParts);
.split(",", Qt::SkipEmptyParts);
for (QString &check : checksList) {
Qt::CheckState state;
@@ -858,7 +858,7 @@ void DiagnosticConfigsWidget::syncClazyWidgets(const ClangDiagnosticConfig &conf
const QStringList checkNames = config.clazyMode()
== ClangDiagnosticConfig::ClazyMode::UseDefaultChecks
? m_clazyInfo.defaultChecks
: config.clazyChecks().split(',', Utils::SkipEmptyParts);
: config.clazyChecks().split(',', Qt::SkipEmptyParts);
m_clazyTreeModel->enableChecks(checkNames);
syncClazyChecksGroupBox();

View File

@@ -418,7 +418,7 @@ QStringList ClearCasePluginPrivate::getVobList() const
const ClearCaseResponse response =
runCleartool(currentState().topLevel(), args, m_settings.timeOutS, SilentRun);
return response.stdOut.split(QLatin1Char('\n'), Utils::SkipEmptyParts);
return response.stdOut.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
}
/// Get the drive letter of a path
@@ -545,7 +545,7 @@ QString ClearCasePluginPrivate::ccManagesDirectory(const QString &directory) con
if (response.error)
return QString();
const QStringList result = response.stdOut.split(QLatin1Char('\n'), Utils::SkipEmptyParts);
const QStringList result = response.stdOut.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
if (result.size() != 2)
return QString();
@@ -894,7 +894,7 @@ QStringList ClearCasePluginPrivate::ccGetActiveVobs() const
prefix += QLatin1Char('/');
const QDir theViewRootDir(theViewRoot);
foreach (const QString &line, response.stdOut.split(QLatin1Char('\n'), Utils::SkipEmptyParts)) {
foreach (const QString &line, response.stdOut.split(QLatin1Char('\n'), Qt::SkipEmptyParts)) {
const bool isActive = line.at(0) == QLatin1Char('*');
if (!isActive)
continue;
@@ -2057,7 +2057,7 @@ QList<QStringPair> ClearCasePluginPrivate::ccGetActivities() const
QStringList args(QLatin1String("lsactivity"));
args << QLatin1String("-fmt") << QLatin1String("%n\\t%[headline]p\\n");
const QString response = runCleartoolSync(currentState().topLevel(), args);
QStringList acts = response.split(QLatin1Char('\n'), Utils::SkipEmptyParts);
QStringList acts = response.split(QLatin1Char('\n'), Qt::SkipEmptyParts);
foreach (const QString &activity, acts) {
QStringList act = activity.split(QLatin1Char('\t'));
if (act.size() >= 2)
@@ -2349,7 +2349,7 @@ QString ClearCasePluginPrivate::runExtDiff(const QString &workingDir, const QStr
int timeOutS, QTextCodec *outputCodec)
{
CommandLine diff("diff");
diff.addArgs(m_settings.diffArgs.split(' ', Utils::SkipEmptyParts));
diff.addArgs(m_settings.diffArgs.split(' ', Qt::SkipEmptyParts));
diff.addArgs(arguments);
SynchronousProcess process;

View File

@@ -286,7 +286,7 @@ QStringList CMakeBuildConfiguration::extraCMakeArguments() const
QStringList CMakeBuildConfiguration::initialCMakeArguments() const
{
return aspect<InitialCMakeArgumentsAspect>()->value().split('\n', Utils::SkipEmptyParts);
return aspect<InitialCMakeArgumentsAspect>()->value().split('\n', Qt::SkipEmptyParts);
}
void CMakeBuildConfiguration::setExtraCMakeArguments(const QStringList &args)

View File

@@ -237,7 +237,7 @@ QStringList splitCommandLine(QString commandLine, QSet<QString> &flagsCache)
}
} else { // If 's' is outside quotes ...
for (const QString &flag :
part.split(QRegularExpression("\\s+"), Utils::SkipEmptyParts)) {
part.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts)) {
auto flagIt = flagsCache.insert(flag);
result.append(*flagIt);
}

View File

@@ -194,7 +194,7 @@ void UrlLocatorFilter::restoreState(const QByteArray &state)
QString value;
in >> value;
m_remoteUrls = value.split('^', Utils::SkipEmptyParts);
m_remoteUrls = value.split('^', Qt::SkipEmptyParts);
QString shortcut;
in >> shortcut;

View File

@@ -188,7 +188,7 @@ void Core::Internal::MenuBarFilter::prepareSearch(const QString &entry)
static const QRegularExpression seperatorRegExp(QString("[%1]").arg(separators));
QString normalized = entry;
normalized.replace(seperatorRegExp, separators.at(0));
const QStringList entryPath = normalized.split(separators.at(0), Utils::SkipEmptyParts);
const QStringList entryPath = normalized.split(separators.at(0), Qt::SkipEmptyParts);
m_entries.clear();
QVector<const QMenu *> processedMenus;
for (QAction* action : menuBarActions())

View File

@@ -382,7 +382,7 @@ void MimeTypeSettingsPrivate::handlePatternEdited()
const Utils::MimeType mt = m_model->m_mimeTypes.at(index);
ensurePendingMimeType(mt);
m_pendingModifiedMimeTypes[mt.name()].globPatterns
= m_ui.patternsLineEdit->text().split(kSemiColon, Utils::SkipEmptyParts);
= m_ui.patternsLineEdit->text().split(kSemiColon, Qt::SkipEmptyParts);
}
void MimeTypeSettingsPrivate::addMagicHeaderRow(const MagicData &data)
@@ -579,7 +579,7 @@ MimeTypeSettingsPrivate::UserMimeTypeHash MimeTypeSettingsPrivate::readUserModif
if (reader.name() == QLatin1String(mimeTypeTagC)) {
mt.name = atts.value(QLatin1String(mimeTypeAttributeC)).toString();
mt.globPatterns = atts.value(QLatin1String(patternAttributeC)).toString()
.split(kSemiColon, Utils::SkipEmptyParts);
.split(kSemiColon, Qt::SkipEmptyParts);
} else if (reader.name() == QLatin1String(matchTagC)) {
QByteArray value = atts.value(QLatin1String(matchValueAttributeC)).toUtf8();
QByteArray typeName = atts.value(QLatin1String(matchTypeAttributeC)).toUtf8();

View File

@@ -312,7 +312,7 @@ public:
}
Core::SearchResultItem item;
item.path = scope.split(QLatin1String("::"), Utils::SkipEmptyParts);
item.path = scope.split(QLatin1String("::"), Qt::SkipEmptyParts);
item.text = text;
item.icon = info->icon();
item.userData = QVariant::fromValue(info);

View File

@@ -255,7 +255,7 @@ static QString validateDiagnosticOptions(const QStringList &options)
static QStringList normalizeDiagnosticInputOptions(const QString &options)
{
return options.simplified().split(QLatin1Char(' '), Utils::SkipEmptyParts);
return options.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts);
}
void ClangDiagnosticConfigsWidget::onClangOnlyOptionsChanged()

View File

@@ -760,7 +760,7 @@ void CompilerOptionsBuilder::evaluateCompilerFlags()
{
static QStringList userBlackList = QString::fromLocal8Bit(
qgetenv("QTC_CLANG_CMD_OPTIONS_BLACKLIST"))
.split(';', Utils::SkipEmptyParts);
.split(';', Qt::SkipEmptyParts);
const Utils::Id &toolChain = m_projectPart.toolchainType;
bool containsDriverMode = false;

View File

@@ -308,7 +308,7 @@ void CppFileSettingsWidget::setLicenseTemplatePath(const QString &lp)
static QStringList trimmedPaths(const QString &paths)
{
QStringList res;
foreach (const QString &path, paths.split(QLatin1Char(','), Utils::SkipEmptyParts))
foreach (const QString &path, paths.split(QLatin1Char(','), Qt::SkipEmptyParts))
res << path.trimmed();
return res;
}

View File

@@ -62,7 +62,7 @@ QList<CvsLogEntry> parseLogEntries(const QString &o,
enum ParseState { FileState, RevisionState, StatusLineState };
QList<CvsLogEntry> rc;
const QStringList lines = o.split('\n', Utils::SkipEmptyParts);
const QStringList lines = o.split('\n', Qt::SkipEmptyParts);
ParseState state = FileState;
const QString workingFilePrefix = QLatin1String("Working file: ");
@@ -178,7 +178,7 @@ StateList parseStatusOutput(const QString &directory, const QString &output)
const QString dotDir = QString(QLatin1Char('.'));
const QChar slash = QLatin1Char('/');
const QStringList list = output.split('\n', Utils::SkipEmptyParts);
const QStringList list = output.split('\n', Qt::SkipEmptyParts);
QString path = directory;
if (!path.isEmpty())

View File

@@ -156,7 +156,7 @@ bool BreakpointParameters::isQmlFileAndLineBreakpoint() const
if (qmlExtensionString.isEmpty())
qmlExtensionString = ".qml;.js";
const auto qmlFileExtensions = qmlExtensionString.splitRef(';', Utils::SkipEmptyParts);
const auto qmlFileExtensions = qmlExtensionString.splitRef(';', Qt::SkipEmptyParts);
const QString file = fileName.toString();
for (const QStringRef &extension : qmlFileExtensions) {
if (file.endsWith(extension, Qt::CaseInsensitive))

View File

@@ -2764,7 +2764,7 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
}
const QString commands = stringSetting(ExtraDumperCommands);
if (!commands.isEmpty()) {
for (const auto &command : commands.split('\n', Utils::SkipEmptyParts))
for (const auto &command : commands.split('\n', Qt::SkipEmptyParts))
runCommand({command, ScriptCommand});
}

View File

@@ -80,7 +80,7 @@ static QString getConfigurationOfGdbCommand(const FilePath &command)
static QString extractGdbTargetAbiStringFromGdbOutput(const QString &gdbOutput)
{
const auto outputLines = gdbOutput.split('\n');
const auto whitespaceSeparatedTokens = outputLines.join(' ').split(' ', Utils::SkipEmptyParts);
const auto whitespaceSeparatedTokens = outputLines.join(' ').split(' ', Qt::SkipEmptyParts);
const QString targetKey{"--target="};
const QString targetValue = Utils::findOrDefault(whitespaceSeparatedTokens,

View File

@@ -2700,7 +2700,7 @@ void GdbEngine::handleShowModuleSections(const DebuggerResponse &response,
active = true;
} else {
if (active) {
QStringList items = line.split(' ', Utils::SkipEmptyParts);
QStringList items = line.split(' ', Qt::SkipEmptyParts);
QString fromTo = items.value(0, QString());
const int pos = fromTo.indexOf('-');
QTC_ASSERT(pos >= 0, continue);
@@ -3189,7 +3189,7 @@ void GdbEngine::handleRegisterListing(const DebuggerResponse &response)
m_registers.clear();
QStringList lines = response.consoleStreamOutput.split('\n');
for (int i = 1; i < lines.size(); ++i) {
const QVector<QStringRef> parts = lines.at(i).splitRef(' ', Utils::SkipEmptyParts);
const QVector<QStringRef> parts = lines.at(i).splitRef(' ', Qt::SkipEmptyParts);
if (parts.size() < 7)
continue;
int gdbRegisterNumber = parts.at(1).toInt();

View File

@@ -384,7 +384,7 @@ static QString addParameterNames(const QString &functionSignature, const QString
const int lastParen = argumentsString.lastIndexOf(')');
if (lastParen != -1)
argumentsString.truncate(lastParen);
const QStringList arguments = argumentsString.split(',', Utils::SkipEmptyParts);
const QStringList arguments = argumentsString.split(',', Qt::SkipEmptyParts);
const int pCount = parameterNames.count();
const int aCount = arguments.count();
for (int i = 0; i < aCount; ++i) {

View File

@@ -648,7 +648,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
VcsOutputWindow::appendError(errorMessage);
}
const QStringList lines = output.split('\n', Utils::SkipEmptyParts);
const QStringList lines = output.split('\n', Qt::SkipEmptyParts);
for (const QString &l : lines) {
QString currentBranch = l.mid(2); // remove first letters (those are either
// " " or "* " depending on whether it is

View File

@@ -291,7 +291,7 @@ QString GerritPushDialog::pushTarget() const
if (!topic.isEmpty())
target += '/' + topic;
const QStringList reviewersInput = reviewers().split(',', Utils::SkipEmptyParts);
const QStringList reviewersInput = reviewers().split(',', Qt::SkipEmptyParts);
for (const QString &reviewer : reviewersInput)
options << "r=" + reviewer;

View File

@@ -851,7 +851,7 @@ QStringList GitClient::unmanagedFiles(const QString &workingDirectory,
if (response.result != SynchronousProcessResponse::Finished)
return filePaths;
const QStringList managedFilePaths
= transform(response.stdOut().split('\0', Utils::SkipEmptyParts),
= transform(response.stdOut().split('\0', Qt::SkipEmptyParts),
[&wd](const QString &fp) { return wd.absoluteFilePath(fp); });
return filtered(filePaths, [&managedFilePaths](const QString &fp) {
return !managedFilePaths.contains(fp);
@@ -3243,7 +3243,7 @@ void GitClient::push(const QString &workingDirectory, const QStringList &pushArg
command->setCookie(NoRemoteBranch);
if (command->cookie().toInt() == NoRemoteBranch) {
const QStringList lines = text.split('\n', Utils::SkipEmptyParts);
const QStringList lines = text.split('\n', Qt::SkipEmptyParts);
for (const QString &line : lines) {
/* Extract the suggested command from the git output which
* should be similar to the following:
@@ -3293,7 +3293,7 @@ void GitClient::push(const QString &workingDirectory, const QStringList &pushArg
QMessageBox::No) == QMessageBox::Yes) {
const QStringList fallbackCommandParts =
m_pushFallbackCommand.split(' ', Utils::SkipEmptyParts);
m_pushFallbackCommand.split(' ', Qt::SkipEmptyParts);
VcsCommand *rePushCommand = vcsExec(workingDirectory,
fallbackCommandParts.mid(1),
nullptr, true, VcsCommand::ShowSuccessMessage);

View File

@@ -270,7 +270,7 @@ void LocalHelpManager::setScrollWheelZoomingEnabled(bool enabled)
QStringList LocalHelpManager::lastShownPages()
{
const QVariant value = Core::ICore::settings()->value(kLastShownPagesKey, QVariant());
return value.toString().split(Constants::ListSeparator, Utils::SkipEmptyParts);
return value.toString().split(Constants::ListSeparator, Qt::SkipEmptyParts);
}
void LocalHelpManager::setLastShownPages(const QStringList &pages)
@@ -282,7 +282,7 @@ QList<float> LocalHelpManager::lastShownPagesZoom()
{
const QVariant value = Core::ICore::settings()->value(kLastShownPagesZoomKey, QVariant());
const QStringList stringValues = value.toString().split(Constants::ListSeparator,
Utils::SkipEmptyParts);
Qt::SkipEmptyParts);
return Utils::transform(stringValues, [](const QString &str) { return str.toFloat(); });
}

View File

@@ -113,7 +113,7 @@ QComboBox *OpenPagesManager::openPagesComboBox() const
QStringList splitString(const QVariant &value)
{
using namespace Help::Constants;
return value.toString().split(ListSeparator, Utils::SkipEmptyParts);
return value.toString().split(ListSeparator, Qt::SkipEmptyParts);
}
void OpenPagesManager::setupInitialPages()

View File

@@ -263,7 +263,7 @@ void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent)
QStringList SearchWidget::currentSearchTerms() const
{
return searchEngine->searchInput().split(QRegularExpression("\\W+"), Utils::SkipEmptyParts);
return searchEngine->searchInput().split(QRegularExpression("\\W+"), Qt::SkipEmptyParts);
}
// #pragma mark -- SearchSideBarItem

View File

@@ -113,7 +113,7 @@ static QVector<QSize> stringToSizes(const QString &s)
{
QVector<QSize> result;
const QString trimmed = s.trimmed();
const QVector<QStringRef> &sizes = trimmed.splitRef(',', Utils::SkipEmptyParts);
const QVector<QStringRef> &sizes = trimmed.splitRef(',', Qt::SkipEmptyParts);
result.reserve(sizes.size());
for (const QStringRef &sizeSpec : sizes) {
const QSize size = sizeFromString(sizeSpec);

View File

@@ -813,8 +813,8 @@ QString BaseSettingsWidget::name() const
LanguageFilter BaseSettingsWidget::filter() const
{
return {m_mimeTypes->text().split(filterSeparator, Utils::SkipEmptyParts),
m_filePattern->text().split(filterSeparator, Utils::SkipEmptyParts)};
return {m_mimeTypes->text().split(filterSeparator, Qt::SkipEmptyParts),
m_filePattern->text().split(filterSeparator, Qt::SkipEmptyParts)};
}
BaseSettings::StartBehavior BaseSettingsWidget::startupBehavior() const
@@ -913,7 +913,7 @@ private:
void BaseSettingsWidget::showAddMimeTypeDialog()
{
MimeTypeDialog dialog(m_mimeTypes->text().split(filterSeparator, Utils::SkipEmptyParts),
MimeTypeDialog dialog(m_mimeTypes->text().split(filterSeparator, Qt::SkipEmptyParts),
Core::ICore::dialogParent());
if (dialog.exec() == QDialog::Rejected)
return;

View File

@@ -429,7 +429,7 @@ public:
QStringList entries() const
{
return textEditWidget()->toPlainText().split(QLatin1Char('\n'), Utils::SkipEmptyParts);
return textEditWidget()->toPlainText().split(QLatin1Char('\n'), Qt::SkipEmptyParts);
}
QString text() const
@@ -548,7 +548,7 @@ void CustomToolChainConfigWidget::applyImpl()
tc->setMakeCommand(m_makeCommand->filePath());
tc->setTargetAbi(m_abiWidget->currentAbi());
Macros macros = Utils::transform<QVector>(
m_predefinedDetails->text().split('\n', Utils::SkipEmptyParts),
m_predefinedDetails->text().split('\n', Qt::SkipEmptyParts),
[](const QString &m) {
return Macro::fromKeyValue(m);
});

View File

@@ -452,7 +452,7 @@ static inline IWizardFactory::WizardKind kindAttribute(const QXmlStreamReader &r
static inline QSet<Id> readRequiredFeatures(const QXmlStreamReader &reader)
{
QString value = reader.attributes().value(QLatin1String(featuresRequiredC)).toString();
QStringList stringList = value.split(QLatin1Char(','), Utils::SkipEmptyParts);
QStringList stringList = value.split(QLatin1Char(','), Qt::SkipEmptyParts);
QSet<Id> features;
foreach (const QString &string, stringList)
features |= Id::fromString(string);

View File

@@ -83,7 +83,7 @@ public:
m_view.setHeaderLabel(varName);
m_view.setDragDropMode(QAbstractItemView::InternalMove);
const QStringList pathList = paths.split(Utils::HostOsInfo::pathListSeparator(),
Utils::SkipEmptyParts);
Qt::SkipEmptyParts);
for (const QString &path : pathList)
addPath(path);
@@ -447,7 +447,7 @@ bool EnvironmentWidget::currentEntryIsPathList(const QModelIndex &current) const
if (valueIndex.column() == 0)
valueIndex = valueIndex.siblingAtColumn(1);
const QStringList entries = d->m_model->data(valueIndex).toString()
.split(Utils::HostOsInfo::pathListSeparator(), Utils::SkipEmptyParts);
.split(Utils::HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
if (entries.length() < 2)
return false;
for (const QString &potentialDir : entries) {

View File

@@ -210,7 +210,7 @@ void JsonSummaryPage::addToProject(const JsonWizard::GeneratorFiles &files)
return;
}
const QStringList dependencies = m_wizard->stringValue("Dependencies")
.split(':', Utils::SkipEmptyParts);
.split(':', Qt::SkipEmptyParts);
if (!dependencies.isEmpty())
folder->addDependencies(dependencies);
}

View File

@@ -324,7 +324,7 @@ static QStringList environmentTemplatesPaths()
if (!envTempPath.isEmpty()) {
for (const QString &path : envTempPath
.split(Utils::HostOsInfo::pathListSeparator(), Utils::SkipEmptyParts)) {
.split(Utils::HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts)) {
QString canonicalPath = QDir(path).canonicalPath();
if (!canonicalPath.isEmpty() && !paths.contains(canonicalPath))
paths.append(canonicalPath);

View File

@@ -2014,7 +2014,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
const QString gitBinary = Core::ICore::settings()->value("Git/BinaryPath", "git")
.toString();
const QStringList rawGitSearchPaths = Core::ICore::settings()->value("Git/Path")
.toString().split(':', Utils::SkipEmptyParts);
.toString().split(':', Qt::SkipEmptyParts);
const Utils::FilePaths gitSearchPaths = Utils::transform(rawGitSearchPaths,
[](const QString &rawPath) { return Utils::FilePath::fromString(rawPath); });
const Utils::FilePath fullGitPath = Utils::Environment::systemEnvironment()

View File

@@ -79,7 +79,7 @@ static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder,
directoryWithoutPrefix = directory;
}
}
QStringList parts = directoryWithoutPrefix.toString().split('/', Utils::SkipEmptyParts);
QStringList parts = directoryWithoutPrefix.toString().split('/', Qt::SkipEmptyParts);
if (!Utils::HostOsInfo::isWindowsHost() && !isRelative && !parts.isEmpty())
parts[0].prepend('/');

View File

@@ -350,7 +350,7 @@ void SelectableFilesModel::collectFiles(Tree *root, Utils::FilePaths *result) co
QList<Glob> SelectableFilesModel::parseFilter(const QString &filter)
{
QList<Glob> result;
const QStringList list = filter.split(QLatin1Char(';'), Utils::SkipEmptyParts);
const QStringList list = filter.split(QLatin1Char(';'), Qt::SkipEmptyParts);
for (const QString &e : list) {
QString entry = e.trimmed();
Glob g;

View File

@@ -51,7 +51,7 @@ static QStringList qt_clean_filter_list(const QString &filter)
QString f = filter;
if (match.hasMatch())
f = match.captured(2);
return f.split(QLatin1Char(' '), Utils::SkipEmptyParts);
return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
}
static bool validateLibraryPath(const Utils::FilePath &filePath,

View File

@@ -2133,7 +2133,7 @@ static QStringList extractFieldsFromBuildString(const QByteArray &buildString)
result.append(match.captured(1)); // qtVersion
// Abi info string:
QStringList abiInfo = match.captured(2).split('-', Utils::SkipEmptyParts);
QStringList abiInfo = match.captured(2).split('-', Qt::SkipEmptyParts);
result.append(abiInfo.takeFirst()); // cpu

View File

@@ -337,9 +337,9 @@ void ExamplesListModel::parseExamples(QXmlStreamReader *reader,
} else if (reader->name() == QLatin1String("dependency")) {
item->dependencies.append(projectsOffset + slash + reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement));
} else if (reader->name() == QLatin1String("tags")) {
item->tags = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), Utils::SkipEmptyParts));
item->tags = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), Qt::SkipEmptyParts));
} else if (reader->name() == QLatin1String("platforms")) {
item->platforms = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), Utils::SkipEmptyParts));
item->platforms = trimStringList(reader->readElementText(QXmlStreamReader::ErrorOnUnexpectedElement).split(QLatin1Char(','), Qt::SkipEmptyParts));
}
break;
case QXmlStreamReader::EndElement:

View File

@@ -88,7 +88,7 @@ private:
{
QList<DeviceProcessItem> processes;
const QStringList lines = listProcessesReply.split(QString::fromLatin1(Delimiter0)
+ QString::fromLatin1(Delimiter1), Utils::SkipEmptyParts);
+ QString::fromLatin1(Delimiter1), Qt::SkipEmptyParts);
foreach (const QString &line, lines) {
const QStringList elements = line.split(QLatin1Char('\n'));
if (elements.count() < 4) {

View File

@@ -108,7 +108,7 @@ void RemoteLinuxEnvironmentReader::remoteProcessFinished()
QString remoteOutput = QString::fromUtf8(m_deviceProcess->readAllStandardOutput());
if (!remoteOutput.isEmpty()) {
m_env = Utils::Environment(remoteOutput.split(QLatin1Char('\n'),
Utils::SkipEmptyParts), Utils::OsTypeLinux);
Qt::SkipEmptyParts), Utils::OsTypeLinux);
}
}
setFinished();

View File

@@ -153,9 +153,9 @@ void ColorThemes::setDocument(ScxmlEditor::PluginInterface::ScxmlDocument *doc)
if (m_document) {
PluginInterface::ScxmlTag *scxmlTag = m_document->scxmlRootTag();
if (scxmlTag && scxmlTag->hasEditorInfo(Constants::C_SCXML_EDITORINFO_COLORS)) {
const QStringList colors = scxmlTag->editorInfo(Constants::C_SCXML_EDITORINFO_COLORS).split(";;", Utils::SkipEmptyParts);
const QStringList colors = scxmlTag->editorInfo(Constants::C_SCXML_EDITORINFO_COLORS).split(";;", Qt::SkipEmptyParts);
for (const QString &color : colors) {
const QStringList colorInfo = color.split("_", Utils::SkipEmptyParts);
const QStringList colorInfo = color.split("_", Qt::SkipEmptyParts);
if (colorInfo.count() == 2)
documentColors[colorInfo[0]] = colorInfo[1];
}

View File

@@ -287,7 +287,7 @@ void GraphicsScene::paste(const QPointF &targetPos)
QString strMinPos = QLatin1String(mimeData->data("StateChartEditor/CopiedMinPos"));
QPointF minPos(0, 0);
if (!strMinPos.isEmpty()) {
QStringList coords = strMinPos.split(":", Utils::SkipEmptyParts);
QStringList coords = strMinPos.split(":", Qt::SkipEmptyParts);
if (coords.count() == 2)
minPos = QPointF(coords[0].toDouble(), coords[1].toDouble());
}

View File

@@ -108,7 +108,7 @@ void Serializer::read(QPoint &d)
void Serializer::setData(const QString &d)
{
m_data = d.split(m_separator, Utils::SkipEmptyParts);
m_data = d.split(m_separator, Qt::SkipEmptyParts);
m_index = 0;
}

View File

@@ -121,7 +121,7 @@ void StateItem::updateAttributes()
// Check initial attribute
QString strNewId = tagValue("id", true);
if (!m_parallelState) {
QStringList NSIDs = strNewId.split(tag()->document()->nameSpaceDelimiter(), Utils::SkipEmptyParts);
QStringList NSIDs = strNewId.split(tag()->document()->nameSpaceDelimiter(), Qt::SkipEmptyParts);
if (!NSIDs.isEmpty()) {
NSIDs[NSIDs.count() - 1] = m_stateNameItem->toPlainText();
QString strOldId = NSIDs.join(tag()->document()->nameSpaceDelimiter());

View File

@@ -151,7 +151,7 @@ StatusList parseStatusOutput(const QString &output)
{
StatusList changeSet;
const QString newLine = QString(QLatin1Char('\n'));
const QStringList list = output.split(newLine, Utils::SkipEmptyParts);
const QStringList list = output.split(newLine, Qt::SkipEmptyParts);
foreach (const QString &l, list) {
const QString line =l.trimmed();
if (line.size() > 8) {

View File

@@ -98,7 +98,7 @@ QString FindInFiles::label() const
const QChar slash = QLatin1Char('/');
const QStringList &nonEmptyComponents = path().toFileInfo().absoluteFilePath()
.split(slash, Utils::SkipEmptyParts);
.split(slash, Qt::SkipEmptyParts);
return tr("%1 \"%2\":")
.arg(title)
.arg(nonEmptyComponents.isEmpty() ? QString(slash) : nonEmptyComponents.last());

View File

@@ -142,7 +142,7 @@ void HighlighterSettings::fromSettings(const QString &category, QSettings *s)
void HighlighterSettings::setIgnoredFilesPatterns(const QString &patterns)
{
setExpressionsFromList(patterns.split(QLatin1Char(','), Utils::SkipEmptyParts));
setExpressionsFromList(patterns.split(QLatin1Char(','), Qt::SkipEmptyParts));
}
QString HighlighterSettings::ignoredFilesPatterns() const

View File

@@ -85,7 +85,7 @@ void QmlJsTodoItemsScanner::processDocument(QmlJS::Document::Ptr doc)
// Process every line
// TODO: Do not create QStringList, just iterate through a string tracking line endings.
QStringList commentLines = source.split('\n', Utils::SkipEmptyParts);
QStringList commentLines = source.split('\n', Qt::SkipEmptyParts);
quint32 startLine = sourceLocation.startLine;
for (int j = 0; j < commentLines.count(); ++j) {
const QString &commentLine = commentLines.at(j);

View File

@@ -294,11 +294,11 @@ void Parser::Private::parseHeader(QIODevice *device)
continue;
} else if (line.startsWith("positions: ")) {
QString values = getValue(line, 11);
data->setPositions(values.split(' ', Utils::SkipEmptyParts));
data->setPositions(values.split(' ', Qt::SkipEmptyParts));
addressValuesCount = data->positions().count();
} else if (line.startsWith("events: ")) {
QString values = getValue(line, 8);
data->setEvents(values.split(' ', Utils::SkipEmptyParts));
data->setEvents(values.split(' ', Qt::SkipEmptyParts));
costValuesCount = data->events().count();
} else if (line.startsWith("version: ")) {
QString value = getValue(line, 9);
@@ -321,7 +321,7 @@ void Parser::Private::parseHeader(QIODevice *device)
} else if (line.startsWith("summary: ")) {
QString values = getValue(line, 9);
uint i = 0;
foreach (const QStringRef &value, values.splitRef(' ', Utils::SkipEmptyParts))
foreach (const QStringRef &value, values.splitRef(' ', Qt::SkipEmptyParts))
data->setTotalCost(i++, value.toULongLong());
} else if (!line.trimmed().isEmpty()) {
// handle line and exit parseHeader

View File

@@ -369,7 +369,7 @@ int VcsBaseClientSettings::vcsTimeoutS() const
QStringList VcsBaseClientSettings::searchPathList() const
{
return stringValue(pathKey).split(HostOsInfo::pathListSeparator(), Utils::SkipEmptyParts);
return stringValue(pathKey).split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
}
QString VcsBaseClientSettings::settingsGroup() const

View File

@@ -103,7 +103,7 @@ CrashHandlerSetup::CrashHandlerSetup(const QString &appName,
return;
if (!QStringList{"1", "all", "yes"}.contains(value)) {
const QString binaryName = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
if (!value.split(",", Utils::SkipEmptyParts).contains(binaryName))
if (!value.split(",", Qt::SkipEmptyParts).contains(binaryName))
return;
}