From 08a9e5670b96294759fa1a22c481d8efa308ce0d Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 19 Jul 2016 23:08:01 +0200 Subject: [PATCH] Minor optimization --- akregator/src/feed/feed.cpp | 4 ++-- kmail/src/kmcommands.cpp | 2 +- pimsettingexporter/core/abstractimportexportjob.cpp | 1 - pimsettingexporter/gui/widgets/selectiontypetreewidget.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/akregator/src/feed/feed.cpp b/akregator/src/feed/feed.cpp index f3901b66e2..784dc64d0d 100644 --- a/akregator/src/feed/feed.cpp +++ b/akregator/src/feed/feed.cpp @@ -717,7 +717,7 @@ void Akregator::Feed::fetchCompleted(Syndication::Loader *l, Syndication::FeedPt d->fetchErrorCode = Syndication::Success; if (d->imagePixmap.isNull()) { - const QString imageFileName = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + QLatin1String("akregator/Media/") + Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png"); + const QString imageFileName = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/akregator/Media/") + Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png"); d->imagePixmap = QPixmap(imageFileName, "PNG"); } @@ -786,7 +786,7 @@ void Akregator::Feed::setImage(const QPixmap &p) return; } d->imagePixmap = p; - const QString filename = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + QString(QLatin1String("akregator/Media/") + Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png")); + const QString filename = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/akregator/Media/") + Utils::fileNameForUrl(d->xmlUrl) + QLatin1String(".png"); QFileInfo fileInfo(filename); QDir().mkpath(fileInfo.absolutePath()); d->imagePixmap.save(filename, "PNG"); diff --git a/kmail/src/kmcommands.cpp b/kmail/src/kmcommands.cpp index 1758075fc2..6b38b3ee7a 100644 --- a/kmail/src/kmcommands.cpp +++ b/kmail/src/kmcommands.cpp @@ -509,7 +509,7 @@ KMAddBookmarksCommand::KMAddBookmarksCommand(const QUrl &url, QWidget *parent) KMCommand::Result KMAddBookmarksCommand::execute() { - const QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QLatin1String("konqueror/bookmarks.xml"); + const QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/konqueror/bookmarks.xml"); QFileInfo fileInfo(filename); QDir().mkpath(fileInfo.absolutePath()); KBookmarkManager *bookManager = KBookmarkManager::managerForFile(filename, QStringLiteral("konqueror")); diff --git a/pimsettingexporter/core/abstractimportexportjob.cpp b/pimsettingexporter/core/abstractimportexportjob.cpp index 048d3de87d..b0b21b6ba7 100644 --- a/pimsettingexporter/core/abstractimportexportjob.cpp +++ b/pimsettingexporter/core/abstractimportexportjob.cpp @@ -114,7 +114,6 @@ void AbstractImportExportJob::backupUiRcFile(const QString &configFileName, cons { const QString configrcStr(configFileName); const QString configrc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/") + application + QLatin1Char('/') + configrcStr; - qDebug() << " configrc" << configrc << " configFileName " << configFileName; if (QFile(configrc).exists()) { backupFile(configrc, Utils::configsPath(), configrcStr); } diff --git a/pimsettingexporter/gui/widgets/selectiontypetreewidget.cpp b/pimsettingexporter/gui/widgets/selectiontypetreewidget.cpp index aa691ef958..1198443eeb 100644 --- a/pimsettingexporter/gui/widgets/selectiontypetreewidget.cpp +++ b/pimsettingexporter/gui/widgets/selectiontypetreewidget.cpp @@ -297,7 +297,7 @@ void SelectionTypeTreeWidget::saveAsDefaultTemplate() TemplateSelection templateSelection; templateSelection.createTemplate(storedType()); const QString templateStr = templateSelection.document().toString(2); - QString ret = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QStringLiteral("pimsettingexporter/"); + QString ret = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/pimsettingexporter/"); QFileInfo fileInfo(ret); QDir().mkpath(fileInfo.absolutePath()); qDebug() << " ret :" << ret; -- 2.11.4.GIT