From cacc01155643d4bc1a57a3dcaab499635d6ddc20 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 17 May 2018 13:55:42 +0200 Subject: [PATCH] Warning-- --- shell/osd.cpp | 2 +- shell/osd.h | 2 +- shell/screenpool.cpp | 2 +- shell/screenpool.h | 2 +- wallpapers/image/backgroundlistmodel.cpp | 9 --------- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/shell/osd.cpp b/shell/osd.cpp index 482e298e8..704854b99 100644 --- a/shell/osd.cpp +++ b/shell/osd.cpp @@ -29,7 +29,7 @@ #include #include -Osd::Osd(KSharedConfig::Ptr config, ShellCorona *corona) +Osd::Osd(const KSharedConfig::Ptr &config, ShellCorona *corona) : QObject(corona) , m_osdUrl(corona->lookAndFeelPackage().fileUrl("osdmainscript")) , m_config(config) diff --git a/shell/osd.h b/shell/osd.h index b04f53a55..11f6fadb9 100644 --- a/shell/osd.h +++ b/shell/osd.h @@ -38,7 +38,7 @@ class Osd : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.osdService") public: - Osd(KSharedConfig::Ptr config, ShellCorona *corona); + Osd(const KSharedConfig::Ptr &config, ShellCorona *corona); ~Osd() override; public Q_SLOTS: diff --git a/shell/screenpool.cpp b/shell/screenpool.cpp index ddfbc9e22..3334331d8 100644 --- a/shell/screenpool.cpp +++ b/shell/screenpool.cpp @@ -31,7 +31,7 @@ #include #endif -ScreenPool::ScreenPool(KSharedConfig::Ptr config, QObject *parent) +ScreenPool::ScreenPool(const KSharedConfig::Ptr &config, QObject *parent) : QObject(parent), m_configGroup(KConfigGroup(config, QStringLiteral("ScreenConnectors"))) { diff --git a/shell/screenpool.h b/shell/screenpool.h index 848d26e3a..e22928941 100644 --- a/shell/screenpool.h +++ b/shell/screenpool.h @@ -34,7 +34,7 @@ class ScreenPool : public QObject, public QAbstractNativeEventFilter Q_OBJECT public: - explicit ScreenPool(KSharedConfig::Ptr config, QObject *parent = nullptr); + explicit ScreenPool(const KSharedConfig::Ptr &config, QObject *parent = nullptr); void load(); ~ScreenPool() override; diff --git a/wallpapers/image/backgroundlistmodel.cpp b/wallpapers/image/backgroundlistmodel.cpp index 94a7d2ed2..5be17d077 100644 --- a/wallpapers/image/backgroundlistmodel.cpp +++ b/wallpapers/image/backgroundlistmodel.cpp @@ -341,7 +341,6 @@ QVariant BackgroundListModel::data(const QModelIndex &index, int role) const return title; } - break; case ScreenshotRole: { QPixmap preview = QPixmap(QSize(m_screenshotSize*1.6, @@ -370,7 +369,6 @@ QVariant BackgroundListModel::data(const QModelIndex &index, int role) const return QVariant(); } - break; case AuthorRole: if (b.metadata().isValid() && !b.metadata().authors().isEmpty()) { @@ -378,7 +376,6 @@ QVariant BackgroundListModel::data(const QModelIndex &index, int role) const } else { return QString(); } - break; case ResolutionRole:{ QSize size = bestSize(b); @@ -389,32 +386,26 @@ QVariant BackgroundListModel::data(const QModelIndex &index, int role) const return QString(); } - break; case PathRole: return QUrl::fromLocalFile(b.filePath("preferred")); - break; case PackageNameRole: return !b.metadata().isValid() || b.metadata().pluginId().isEmpty() ? b.filePath("preferred") : b.metadata().pluginId(); - break; case RemovableRole: { QString localWallpapers = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/wallpapers/"; QString path = b.filePath("preferred"); return path.startsWith(localWallpapers) || m_removableWallpapers.contains(path); } - break; case PendingDeletionRole: { QUrl wallpaperUrl = QUrl::fromLocalFile(b.filePath("preferred")); return m_pendingDeletion.contains(wallpaperUrl.toLocalFile()) ? m_pendingDeletion[wallpaperUrl.toLocalFile()] : false; } - break; default: return QVariant(); - break; } Q_UNREACHABLE();