Commit cacc0115 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Warning--

parent 92a98735
......@@ -29,7 +29,7 @@
#include <KDeclarative/QmlObjectSharedEngine>
#include <klocalizedstring.h>
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)
......
......@@ -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:
......
......@@ -31,7 +31,7 @@
#include <xcb/xcb_event.h>
#endif
ScreenPool::ScreenPool(KSharedConfig::Ptr config, QObject *parent)
ScreenPool::ScreenPool(const KSharedConfig::Ptr &config, QObject *parent)
: QObject(parent),
m_configGroup(KConfigGroup(config, QStringLiteral("ScreenConnectors")))
{
......
......@@ -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;
......
......@@ -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();
......
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