properly forward containmentDisplayHintsChanged
make possible to write containmentDisplayHintsChanged from ContainmentInterface QML when containmentDisplayHintsChanged, the containment forwards to all its applets
This commit is contained in:
parent
0e973e852f
commit
da6b8c10c1
@ -407,6 +407,7 @@ void Containment::addApplet(Applet *applet)
|
|||||||
emit currentContainment->appletRemoved(applet);
|
emit currentContainment->appletRemoved(applet);
|
||||||
|
|
||||||
disconnect(applet, nullptr, currentContainment, nullptr);
|
disconnect(applet, nullptr, currentContainment, nullptr);
|
||||||
|
connect(currentContainment, nullptr, applet, nullptr);
|
||||||
KConfigGroup oldConfig = applet->config();
|
KConfigGroup oldConfig = applet->config();
|
||||||
currentContainment->d->applets.removeAll(applet);
|
currentContainment->d->applets.removeAll(applet);
|
||||||
applet->setParent(this);
|
applet->setParent(this);
|
||||||
@ -449,6 +450,7 @@ void Containment::addApplet(Applet *applet)
|
|||||||
connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*)));
|
connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*)));
|
||||||
connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus)));
|
connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus)));
|
||||||
connect(applet, &Applet::activated, this, &Applet::activated);
|
connect(applet, &Applet::activated, this, &Applet::activated);
|
||||||
|
connect(this, &Containment::containmentDisplayHintsChanged, applet, &Applet::containmentDisplayHintsChanged);
|
||||||
|
|
||||||
if (!currentContainment) {
|
if (!currentContainment) {
|
||||||
const bool isNew = applet->d->mainConfigGroup()->entryMap().isEmpty();
|
const bool isNew = applet->d->mainConfigGroup()->entryMap().isEmpty();
|
||||||
|
@ -872,6 +872,12 @@ QList<QObject *> ContainmentInterface::actions() const
|
|||||||
return actionList;
|
return actionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContainmentInterface::setContainmentDisplayHints(Plasma::Types::ContainmentDisplayHints hints)
|
||||||
|
{
|
||||||
|
m_containment->setContainmentDisplayHints(hints);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//PROTECTED--------------------
|
//PROTECTED--------------------
|
||||||
|
|
||||||
void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event)
|
void ContainmentInterface::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
@ -75,6 +75,8 @@ class ContainmentInterface : public AppletInterface
|
|||||||
*/
|
*/
|
||||||
Q_PROPERTY(bool editMode READ isEditMode WRITE setEditMode NOTIFY editModeChanged)
|
Q_PROPERTY(bool editMode READ isEditMode WRITE setEditMode NOTIFY editModeChanged)
|
||||||
|
|
||||||
|
Q_PROPERTY(Plasma::Types::ContainmentDisplayHints containmentDisplayHints READ containmentDisplayHints WRITE setContainmentDisplayHints NOTIFY containmentDisplayHintsChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args = QVariantList());
|
ContainmentInterface(DeclarativeAppletScript *parent, const QVariantList &args = QVariantList());
|
||||||
|
|
||||||
@ -100,6 +102,8 @@ public:
|
|||||||
|
|
||||||
QList<QObject *> actions() const;
|
QList<QObject *> actions() const;
|
||||||
|
|
||||||
|
void setContainmentDisplayHints(Plasma::Types::ContainmentDisplayHints hints);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button
|
* Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user