manage the case a containment behaves as an applet
however loading mechanism should be changed to make applets in containments always be an Applet*
This commit is contained in:
parent
b8b3c0a89c
commit
395dc9b381
@ -262,8 +262,6 @@ Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList
|
||||
applet->setLaunchErrorMessage(i18n("Could not find requested component: %1", name));
|
||||
}
|
||||
|
||||
//kDebug() << applet->title() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();
|
||||
|
||||
q->addApplet(applet);
|
||||
return applet;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ void AppletInterface::init()
|
||||
|
||||
//Create the ToolBox
|
||||
Plasma::Containment *pc = qobject_cast<Plasma::Containment *>(applet());
|
||||
if (pc) {
|
||||
if (pc && !qobject_cast<Plasma::Applet *>(pc->parent())) {
|
||||
KConfigGroup defaults;
|
||||
if (pc->containmentType() == Plasma::DesktopContainment) {
|
||||
defaults = KConfigGroup(KSharedConfig::openConfig(pc->corona()->package().filePath("defaults")), "Desktop");
|
||||
|
@ -233,10 +233,10 @@ Q_SIGNALS:
|
||||
|
||||
//it's important those slots are private because must not be invokable by qml
|
||||
private Q_SLOTS:
|
||||
void init();
|
||||
void configureTriggered();
|
||||
|
||||
protected:
|
||||
virtual void init();
|
||||
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
|
||||
void itemChange(ItemChange change, const ItemChangeData &value);
|
||||
void setConfigurationInterfaceShown(bool show);
|
||||
|
@ -46,6 +46,13 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
|
||||
|
||||
qmlRegisterType<ContainmentInterface>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void ContainmentInterface::init()
|
||||
{
|
||||
AppletInterface::init();
|
||||
|
||||
connect(containment(), &Plasma::Containment::appletRemoved,
|
||||
this, &ContainmentInterface::appletRemovedForward);
|
||||
connect(containment(), &Plasma::Containment::appletAdded,
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
};
|
||||
ContainmentInterface(DeclarativeAppletScript *parent);
|
||||
//Not for QML
|
||||
inline Plasma::Containment *containment() const { return static_cast<Plasma::Containment *>(m_appletScriptEngine->applet()); }
|
||||
inline Plasma::Containment *containment() const { return static_cast<Plasma::Containment *>(m_appletScriptEngine->applet()->containment()); }
|
||||
|
||||
inline WallpaperInterface *wallpaperInterface() const { return m_wallpaperInterface;}
|
||||
|
||||
@ -70,6 +70,7 @@ public:
|
||||
Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
|
||||
|
||||
protected:
|
||||
void init();
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user