You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
plasma-desktop/0003-Add-missing-appletInte...

100 lines
3.5 KiB

From 12a64ed82308b9a368d42f641fb23da8b18c3000 Mon Sep 17 00:00:00 2001
From: Eike Hein <hein@kde.org>
Date: Sat, 9 Jan 2016 01:56:26 +0100
Subject: [PATCH 3/4] Add missing appletInterface prop.
BUG:357638
---
applets/kicker/plugin/computermodel.cpp | 15 +++++++++++++++
applets/kicker/plugin/computermodel.h | 6 ++++++
applets/kickoff/package/contents/ui/ComputerView.qml | 2 ++
3 files changed, 23 insertions(+)
diff --git a/applets/kicker/plugin/computermodel.cpp b/applets/kicker/plugin/computermodel.cpp
index ffbe6d0..cff2928 100644
--- a/applets/kicker/plugin/computermodel.cpp
+++ b/applets/kicker/plugin/computermodel.cpp
@@ -140,6 +140,7 @@ ComputerModel::ComputerModel(QObject *parent) : ForwardingModel(parent)
, m_systemAppsModel(new FavoritesModel(this))
, m_filteredPlacesModel(new FilteredPlacesModel(this))
, m_appNameFormat(AppEntry::NameOnly)
+, m_appletInterface(nullptr)
{
connect(m_systemAppsModel, &FavoritesModel::favoritesChanged, this, &ComputerModel::systemApplicationsChanged);
m_systemAppsModel->setFavorites(QStringList() << "systemsettings.desktop");
@@ -176,6 +177,20 @@ void ComputerModel::setAppNameFormat(int format)
}
}
+QObject *ComputerModel::appletInterface() const
+{
+ return m_appletInterface;
+}
+
+void ComputerModel::setAppletInterface(QObject *appletInterface)
+{
+ if (m_appletInterface != appletInterface) {
+ m_appletInterface = appletInterface;
+
+ emit appletInterfaceChanged();
+ }
+}
+
QStringList ComputerModel::systemApplications() const
{
return m_systemAppsModel->favorites();
diff --git a/applets/kicker/plugin/computermodel.h b/applets/kicker/plugin/computermodel.h
index bd811a2..ba82d7a 100644
--- a/applets/kicker/plugin/computermodel.h
+++ b/applets/kicker/plugin/computermodel.h
@@ -75,6 +75,7 @@ class ComputerModel : public ForwardingModel
Q_OBJECT
Q_PROPERTY(int appNameFormat READ appNameFormat WRITE setAppNameFormat NOTIFY appNameFormatChanged)
+ Q_PROPERTY(QObject* appletInterface READ appletInterface WRITE setAppletInterface NOTIFY appletInterfaceChanged)
Q_PROPERTY(QStringList systemApplications READ systemApplications WRITE setSystemApplications NOTIFY systemApplicationsChanged)
public:
@@ -86,6 +87,9 @@ class ComputerModel : public ForwardingModel
int appNameFormat() const;
void setAppNameFormat(int format);
+ QObject *appletInterface() const;
+ void setAppletInterface(QObject *appletInterface);
+
QStringList systemApplications() const;
void setSystemApplications(const QStringList &apps);
@@ -95,6 +99,7 @@ class ComputerModel : public ForwardingModel
Q_SIGNALS:
void appNameFormatChanged() const;
+ void appletInterfaceChanged() const;
void systemApplicationsChanged() const;
private Q_SLOTS:
@@ -106,6 +111,7 @@ class ComputerModel : public ForwardingModel
FavoritesModel *m_systemAppsModel;
FilteredPlacesModel *m_filteredPlacesModel;
AppEntry::NameFormat m_appNameFormat;
+ QObject *m_appletInterface;
};
#endif
diff --git a/applets/kickoff/package/contents/ui/ComputerView.qml b/applets/kickoff/package/contents/ui/ComputerView.qml
index bfdc5f8..0cb189d 100644
--- a/applets/kickoff/package/contents/ui/ComputerView.qml
+++ b/applets/kickoff/package/contents/ui/ComputerView.qml
@@ -28,6 +28,8 @@ BaseView {
appNameFormat: rootModel.appNameFormat
+ appletInterface: plasmoid
+
favoritesModel: globalFavorites
Component.onCompleted: {
--
2.5.0