Commit f372f174 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated Plasma::Package to KPackage::Package

parent 443143fb
......@@ -26,8 +26,7 @@
#include <QQmlEngine>
#include <QQuickItem>
#include <Plasma/Package>
#include <Plasma/PluginLoader>
#include <KPackage/PackageLoader>
#include <KDeclarative/KDeclarative>
#include <KLocalizedString>
......@@ -51,7 +50,7 @@ View::View(const QString &category, QCommandLineParser &parser, QWindow *parent)
rootContext()->setContextProperty("pickerMode", parser.isSet("picker"));
qmlRegisterType<IconModel>();
m_package = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
m_package = KPackage::PackageLoader::self()->loadPackage("Plasma/Generic");
m_package.setPath("org.kde.plasma.cuttlefish");
if (!m_package.isValid() || !m_package.metadata().isValid()) {
......@@ -59,7 +58,7 @@ View::View(const QString &category, QCommandLineParser &parser, QWindow *parent)
return;
}
setIcon(QIcon::fromTheme(m_package.metadata().icon()));
setIcon(QIcon::fromTheme(m_package.metadata().iconName()));
setTitle(m_package.metadata().name());
const QString qmlFile = m_package.filePath("mainscript");
......
......@@ -26,7 +26,7 @@
#include <KDirModel>
#include <KDirLister>
#include <Plasma/Package>
#include <KPackage/Package>
namespace CuttleFish {
......@@ -42,7 +42,7 @@ Q_SIGNALS:
void titleChanged(const QString&);
private:
Plasma::Package m_package;
KPackage::Package m_package;
QQuickItem* m_browserRootItem;
KDirModel m_dirModel;
};
......
......@@ -29,8 +29,8 @@
#include <KLocalizedString>
#include <KDesktopFile>
#include <Plasma/Package>
#include <Plasma/PluginLoader>
#include <KPackage/Package>
#include <KPackage/PackageLoader>
class ViewerCorona : public Plasma::Corona
......@@ -66,7 +66,7 @@ View::View(ViewerCorona *cor, bool konsoleVisible, QWindow *parent)
cor->setView(this);
m_konsoleVisible = konsoleVisible;
engine()->rootContext()->setContextProperty("desktop", this);
setSource(QUrl::fromLocalFile(cor->package().filePath("views", "Desktop.qml")));
setSource(QUrl::fromLocalFile(cor->kPackage().filePath("views", "Desktop.qml")));
}
View::~View()
......@@ -286,11 +286,11 @@ void View::changeLocation(int location)
ViewerCorona *View::createCorona()
{
Plasma::Package package = Plasma::PluginLoader::self()->loadPackage("Plasma/Shell");
KPackage::Package package = KPackage::PackageLoader::self()->loadPackage("Plasma/Shell");
package.setPath("org.kde.plasma.plasmoidviewershell");
ViewerCorona *cor = new ViewerCorona();
cor->setPackage(package);
cor->setKPackage(package);
return cor;
}
......
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