Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 935b6190 authored by Laurent Montel's avatar Laurent Montel 😁

Use QLatin1Char

parent 664865f1
......@@ -252,7 +252,7 @@ void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::initGUI()
const QString desktopPath = selectApplicationDialogUi.treeView->model()->data(selectApplicationDialogUi.treeView->selectionModel()->selectedIndexes().first(), Qt::UserRole+1).toString();
if (!desktopPath.isEmpty() &&QFile::exists(desktopPath) ) {
const QString desktopFile = desktopPath.split(QChar('/')).last();
const QString desktopFile = desktopPath.split(QLatin1Char('/')).last();
if (!desktopPath.isEmpty()) {
KDesktopFile sourceDF(desktopPath);
......@@ -275,7 +275,7 @@ void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::initGUI()
KGlobalAccel::self()->setShortcut(action, QList<QKeySequence>());
QStringList sequencesStrings = sourceDF.actionGroup(actionId).readEntry(QStringLiteral("X-KDE-Shortcuts"), QString()).split(QChar(','));
QStringList sequencesStrings = sourceDF.actionGroup(actionId).readEntry(QStringLiteral("X-KDE-Shortcuts"), QString()).split(QLatin1Char('/'));
QList<QKeySequence> sequences;
if (!sequencesStrings.isEmpty()) {
Q_FOREACH (const QString &seqString, sequencesStrings) {
......@@ -297,7 +297,7 @@ void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::initGUI()
KGlobalAccel::self()->setShortcut(action, QList<QKeySequence>());
QStringList sequencesStrings = sourceDF.desktopGroup().readEntry(QStringLiteral("X-KDE-Shortcuts"), QString()).split(QChar(','));
QStringList sequencesStrings = sourceDF.desktopGroup().readEntry(QStringLiteral("X-KDE-Shortcuts"), QString()).split(QLatin1Char('/'));
QList<QKeySequence> sequences;
if (!sequencesStrings.isEmpty()) {
Q_FOREACH (const QString &seqString, sequencesStrings) {
......
......@@ -70,7 +70,7 @@ void CFcQuery::procExited()
{
QString family;
int weight(KFI_NULL_SETTING), slant(KFI_NULL_SETTING), width(KFI_NULL_SETTING);
QStringList results(QString::fromUtf8(itsBuffer, itsBuffer.length()).split('\n'));
QStringList results(QString::fromUtf8(itsBuffer, itsBuffer.length()).split(QLatin1Char('\n')));
if(results.size())
{
......
......@@ -163,7 +163,7 @@ static QString removeKnownExtension(const QUrl &url)
CKioFonts::CKioFonts(const QByteArray &pool, const QByteArray &app)
: KIO::SlaveBase(KFI_KIO_FONTS_PROTOCOL, pool, app)
, itsInterface(new FontInstInterface())
, itsTempDir(0L)
, itsTempDir(nullptr)
{
KFI_DBUG;
}
......@@ -179,7 +179,7 @@ void CKioFonts::listDir(const QUrl &url)
{
KFI_DBUG << url;
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split('/', QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
EFolder folder=Misc::root() ? FOLDER_SYS : getFolder(pathList);
KIO::UDSEntry entry;
int size=0;
......@@ -214,7 +214,7 @@ void CKioFonts::listDir(const QUrl &url)
void CKioFonts::put(const QUrl &url, int /*permissions*/, KIO::JobFlags /*flags*/)
{
KFI_DBUG << url;
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split('/', QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
EFolder folder(getFolder(pathList));
if(!Misc::root() && FOLDER_ROOT==folder)
......@@ -281,7 +281,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('/', QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
EFolder folder(getFolder(pathList));
Family family(getFont(url, folder));
......@@ -484,7 +484,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('/', QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
EFolder folder(getFolder(pathList));
QString name(removeKnownExtension(url));
......@@ -504,7 +504,7 @@ void CKioFonts::statFont(const QUrl &url)
{
KFI_DBUG << url;
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split('/', QString::SkipEmptyParts));
QStringList pathList(url.adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
EFolder folder=getFolder(pathList);
KIO::UDSEntry entry;
bool ok=true;
......
......@@ -255,13 +255,13 @@ void CFontViewPart::timeout()
if(!found)
{
// Check if url is "fonts:/<font> if so try fonts:/System/<font>, then fonts:/Personal<font>
QStringList pathList(url().adjusted(QUrl::StripTrailingSlash).path().split('/', QString::SkipEmptyParts));
QStringList pathList(url().adjusted(QUrl::StripTrailingSlash).path().split(QLatin1Char('/'), QString::SkipEmptyParts));
if(pathList.count()==1)
{
found = statUrl(QUrl(QString("fonts:/"+i18n(KFI_KIO_FONTS_SYS)+'/'+pathList[0])), &udsEntry);
found = statUrl(QUrl(QString("fonts:/"+i18n(KFI_KIO_FONTS_SYS)+QLatin1Char('/')+pathList[0])), &udsEntry);
if (!found)
found = statUrl(QUrl(QString("fonts:/"+i18n(KFI_KIO_FONTS_USER)+'/'+pathList[0])), &udsEntry);
found = statUrl(QUrl(QString("fonts:/"+i18n(KFI_KIO_FONTS_USER)+QLatin1Char('/')+pathList[0])), &udsEntry);
}
}
......
......@@ -94,7 +94,7 @@ static void applyGtkStyles(bool active, int version)
{
QString gtkkde = writableGtkrc(version);
QByteArray gtkrc = getenv(gtkEnvVar(version));
QStringList list = QFile::decodeName(gtkrc).split( ':');
QStringList list = QFile::decodeName(gtkrc).split( QLatin1Char(':'));
QString userHomeGtkrc = QDir::homePath()+userGtkrc(version);
if (!list.contains(userHomeGtkrc))
list.prepend(userHomeGtkrc);
......@@ -292,7 +292,7 @@ static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTh
bool exist_gtkrc = false;
QByteArray gtkrc = getenv(gtkEnvVar(version));
QStringList listGtkrc = QFile::decodeName(gtkrc).split(QStringLiteral(":"));
QStringList listGtkrc = QFile::decodeName(gtkrc).split(QLatin1Char(':'));
if (listGtkrc.contains(saveFile.fileName()))
listGtkrc.removeAll(saveFile.fileName());
listGtkrc.append(QDir::homePath() + userGtkrc(version));
......@@ -315,7 +315,7 @@ static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTh
gtk2ThemeFilename.clear();
QByteArray xdgDataDirs = getenv("XDG_DATA_DIRS");
gtk2ThemePath.append(QDir::homePath() + "/.local");
gtk2ThemePath.append(QFile::decodeName(xdgDataDirs).split(QStringLiteral(":")));
gtk2ThemePath.append(QFile::decodeName(xdgDataDirs).split(QLatin1Char(':')));
gtk2ThemePath.removeDuplicates();
for (int i = 0; i < gtk2ThemePath.size(); ++i)
{
......
Markdown is supported
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