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));
|
applet->setLaunchErrorMessage(i18n("Could not find requested component: %1", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
//kDebug() << applet->title() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();
|
|
||||||
|
|
||||||
q->addApplet(applet);
|
q->addApplet(applet);
|
||||||
return applet;
|
return applet;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ void AppletInterface::init()
|
|||||||
|
|
||||||
//Create the ToolBox
|
//Create the ToolBox
|
||||||
Plasma::Containment *pc = qobject_cast<Plasma::Containment *>(applet());
|
Plasma::Containment *pc = qobject_cast<Plasma::Containment *>(applet());
|
||||||
if (pc) {
|
if (pc && !qobject_cast<Plasma::Applet *>(pc->parent())) {
|
||||||
KConfigGroup defaults;
|
KConfigGroup defaults;
|
||||||
if (pc->containmentType() == Plasma::DesktopContainment) {
|
if (pc->containmentType() == Plasma::DesktopContainment) {
|
||||||
defaults = KConfigGroup(KSharedConfig::openConfig(pc->corona()->package().filePath("defaults")), "Desktop");
|
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
|
//it's important those slots are private because must not be invokable by qml
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void init();
|
|
||||||
void configureTriggered();
|
void configureTriggered();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void init();
|
||||||
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
|
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
|
||||||
void itemChange(ItemChange change, const ItemChangeData &value);
|
void itemChange(ItemChange change, const ItemChangeData &value);
|
||||||
void setConfigurationInterfaceShown(bool show);
|
void setConfigurationInterfaceShown(bool show);
|
||||||
|
@ -46,6 +46,13 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
|
|||||||
|
|
||||||
qmlRegisterType<ContainmentInterface>();
|
qmlRegisterType<ContainmentInterface>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ContainmentInterface::init()
|
||||||
|
{
|
||||||
|
AppletInterface::init();
|
||||||
|
|
||||||
connect(containment(), &Plasma::Containment::appletRemoved,
|
connect(containment(), &Plasma::Containment::appletRemoved,
|
||||||
this, &ContainmentInterface::appletRemovedForward);
|
this, &ContainmentInterface::appletRemovedForward);
|
||||||
connect(containment(), &Plasma::Containment::appletAdded,
|
connect(containment(), &Plasma::Containment::appletAdded,
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
};
|
};
|
||||||
ContainmentInterface(DeclarativeAppletScript *parent);
|
ContainmentInterface(DeclarativeAppletScript *parent);
|
||||||
//Not for QML
|
//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;}
|
inline WallpaperInterface *wallpaperInterface() const { return m_wallpaperInterface;}
|
||||||
|
|
||||||
@ -70,6 +70,7 @@ public:
|
|||||||
Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
|
Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void init();
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
void mouseReleaseEvent(QMouseEvent *event);
|
void mouseReleaseEvent(QMouseEvent *event);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user