Commit fd1f77d5 authored by Cyril Rossi's avatar Cyril Rossi
Browse files

KCMSplashScreen fix warning, use KPackage::Package instead of Plasma::Package

Reviewers: #plasma, ervin, mart

Differential Revision: https://phabricator.kde.org/D24731
parent 77b27da4
......@@ -30,7 +30,7 @@
#include <QStandardItemModel>
#include <QDir>
#include <Plasma/PluginLoader>
#include <KPackage/PackageLoader>
#include <KNewStuff3/KNS3/DownloadDialog>
......@@ -63,9 +63,9 @@ KCMSplashScreen::KCMSplashScreen(QObject* parent, const QVariantList& args)
loadModel();
}
QList<Plasma::Package> KCMSplashScreen::availablePackages(const QString &component)
QList<KPackage::Package> KCMSplashScreen::availablePackages(const QString &component)
{
QList<Plasma::Package> packages;
QList<KPackage::Package> packages;
QStringList paths;
const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
......@@ -75,9 +75,9 @@ QList<Plasma::Package> KCMSplashScreen::availablePackages(const QString &compone
}
for (const QString &path : paths) {
Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel"));
KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel"));
pkg.setPath(path);
pkg.setFallbackPackage(Plasma::Package());
pkg.setFallbackPackage(KPackage::Package());
if (component.isEmpty() || !pkg.filePath(component.toUtf8()).isEmpty()) {
packages << pkg;
}
......@@ -111,12 +111,12 @@ void KCMSplashScreen::loadModel()
{
m_model->clear();
const QList<Plasma::Package> pkgs = availablePackages(QStringLiteral("splashmainscript"));
for (const Plasma::Package &pkg : pkgs) {
const QList<KPackage::Package> pkgs = availablePackages(QStringLiteral("splashmainscript"));
for (const KPackage::Package &pkg : pkgs) {
QStandardItem* row = new QStandardItem(pkg.metadata().name());
row->setData(pkg.metadata().pluginName(), PluginNameRole);
row->setData(pkg.metadata().pluginId(), PluginNameRole);
row->setData(pkg.filePath("previews", QStringLiteral("splash.png")), ScreenshotRole);
row->setData(pkg.metadata().comment(), DescriptionRole);
row->setData(pkg.metadata().description(), DescriptionRole);
m_model->appendRow(row);
}
m_model->sort(0 /*column*/);
......
......@@ -21,7 +21,7 @@
#ifndef _KCM_SEARCH_H
#define _KCM_SEARCH_H
#include <Plasma/Package>
#include <KPackage/Package>
#include <KQuickAddons/ConfigModule>
class QStandardItemModel;
......@@ -62,7 +62,7 @@ Q_SIGNALS:
private:
void loadModel();
QList<Plasma::Package> availablePackages(const QString &component);
QList<KPackage::Package> availablePackages(const QString &component);
SplashScreenSettings *m_settings;
QStandardItemModel *m_model;
......
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