Commit 78f04b58 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port from QString::SkipEmptyParts to Qt::SkipEmptyParts

parent ec6f5b47
......@@ -126,7 +126,7 @@ void KSolidNotify::queryBlockingApps(const QString &devicePath)
connect(p, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), [=](int, QProcess::ExitStatus) {
QStringList blockApps;
QString out(p->readAll());
const QVector<QStringRef> pidList = out.splitRef(QRegularExpression(QStringLiteral("\\s+")), QString::SkipEmptyParts);
const QVector<QStringRef> pidList = out.splitRef(QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts);
KSysGuard::Processes procs;
for (const QStringRef &pidStr : pidList) {
int pid = pidStr.toInt();
......
......@@ -197,7 +197,7 @@ bool DictEngine::sourceRequestEvent(const QString &query)
m_tcpSocket = nullptr;
}
QStringList queryParts = query.split(':', QString::SkipEmptyParts);
QStringList queryParts = query.split(':', Qt::SkipEmptyParts);
if (queryParts.isEmpty()) {
return false;
}
......
......@@ -253,7 +253,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
}
// FIXME: If last part of path is not "icons", this won't work!
QString appName;
auto tokens = path.splitRef('/', QString::SkipEmptyParts);
auto tokens = path.splitRef('/', Qt::SkipEmptyParts);
if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons"))
appName = tokens.takeLast().toString();
......
......@@ -72,7 +72,7 @@ void TimeSource::setTimeZone(const QString &tz)
const QString trTimezone = i18n(m_tzName.toUtf8());
setData(I18N_NOOP("Timezone"), trTimezone);
const QStringList tzParts = trTimezone.split('/', QString::SkipEmptyParts);
const QStringList tzParts = trTimezone.split('/', Qt::SkipEmptyParts);
if (tzParts.count() == 1) {
// no '/' so just set it as the city
setData(I18N_NOOP("Timezone City"), trTimezone);
......@@ -162,7 +162,7 @@ QString TimeSource::parseName(const QString &name)
static const QString datetime = I18N_NOOP("DateTime");
// now parse out what we got handed in
const QStringList list = name.split('|', QString::SkipEmptyParts);
const QStringList list = name.split('|', Qt::SkipEmptyParts);
const int listSize = list.size();
for (int i = 1; i < listSize; ++i) {
......
......@@ -207,7 +207,7 @@ void MenuProxy::writeGtk2Settings()
continue;
}
gtkModules = line.mid(equalSignIdx + 1).split(QLatin1Char(':'), QString::SkipEmptyParts);
gtkModules = line.mid(equalSignIdx + 1).split(QLatin1Char(':'), Qt::SkipEmptyParts);
break;
}
......@@ -238,7 +238,7 @@ void MenuProxy::writeGtk3Settings()
auto cfg = KSharedConfig::openConfig(gtk3SettingsIniPath(), KConfig::NoGlobals);
KConfigGroup group(cfg, "Settings");
QStringList gtkModules = group.readEntry("gtk-modules", QString()).split(QLatin1Char(':'), QString::SkipEmptyParts);
QStringList gtkModules = group.readEntry("gtk-modules", QString()).split(QLatin1Char(':'), Qt::SkipEmptyParts);
addOrRemoveAppMenuGtkModule(gtkModules);
if (!gtkModules.isEmpty()) {
......
......@@ -258,7 +258,7 @@ void KCMColors::editScheme(const QString &schemeName, QQuickItem *ctx)
Q_UNUSED(exitCode);
Q_UNUSED(exitStatus);
const auto savedThemes = QString::fromUtf8(m_editDialogProcess->readAllStandardOutput()).split(QLatin1Char('\n'), QString::SkipEmptyParts);
const auto savedThemes = QString::fromUtf8(m_editDialogProcess->readAllStandardOutput()).split(QLatin1Char('\n'), Qt::SkipEmptyParts);
if (!savedThemes.isEmpty()) {
m_model->load(); // would be cool to just reload/add the changed/new ones
......
......@@ -253,7 +253,7 @@ void CKioFonts::put(const QUrl &url, int /*permissions*/, KIO::JobFlags /*flags*
void CKioFonts::get(const QUrl &url)
{
KFI_DBUG << url;
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), Qt::SkipEmptyParts));
EFolder folder(getFolder(pathList));
Family family(getFont(url, folder));
......@@ -434,7 +434,7 @@ void CKioFonts::rename(const QUrl &, const QUrl &, KIO::JobFlags)
void CKioFonts::del(const QUrl &url, bool isFile)
{
KFI_DBUG << url;
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), Qt::SkipEmptyParts));
EFolder folder(getFolder(pathList));
QString name(removeKnownExtension(url));
......
......@@ -31,7 +31,7 @@ TranslationsSettings::~TranslationsSettings()
QStringList TranslationsSettings::configuredLanguages() const
{
return languageString().split(QLatin1Char(':'), QString::SkipEmptyParts);
return languageString().split(QLatin1Char(':'), Qt::SkipEmptyParts);
}
void TranslationsSettings::setConfiguredLanguages(const QStringList &langs)
......
......@@ -788,7 +788,7 @@ void KSMServer::storeSession()
KSharedConfig::Ptr config = KSharedConfig::openConfig();
config->reparseConfiguration(); // config may have changed in the KControl module
KConfigGroup generalGroup(config, "General");
excludeApps = generalGroup.readEntry("excludeApps").toLower().split(QRegularExpression(QStringLiteral("[,:]")), QString::SkipEmptyParts);
excludeApps = generalGroup.readEntry("excludeApps").toLower().split(QRegularExpression(QStringLiteral("[,:]")), Qt::SkipEmptyParts);
KConfigGroup configSessionGroup(config, sessionGroup);
int count = configSessionGroup.readEntry("count", 0);
for (int i = 1; i <= count; i++) {
......
......@@ -87,7 +87,7 @@ void Opera::prepare()
// load contents
QString contents = operaBookmarksFile.readAll();
m_operaBookmarkEntries = contents.split(QStringLiteral("\n\n"), QString::SkipEmptyParts);
m_operaBookmarkEntries = contents.split(QStringLiteral("\n\n"), Qt::SkipEmptyParts);
// close file
operaBookmarksFile.close();
......
......@@ -327,7 +327,7 @@ template<typename Object> void loadSerializedConfigs(Object *object, const QJSVa
SCRIPT_OBJECT_FOREACH(escapedGroup, config, configs)
{
// If the config group is set, pass it on to the containment
QStringList groups = escapedGroup.split('/', QString::SkipEmptyParts);
QStringList groups = escapedGroup.split('/', Qt::SkipEmptyParts);
for (QString &group : groups) {
group = QUrl::fromPercentEncoding(group.toUtf8());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment