AppletQuickItem: Do not remember the popup dialog size

The popup dialog can currently never be resized, so it doesn't make
sense to record its height in a config file. Additionally, this also
causes problems when applet writers change the size of their plasmoid.
Since the old size is saved in the config file, it is shown with the old
dimensions instead of the new ones.

REVIEW: 118849
BUG: 336070
This commit is contained in:
Vishesh Handa 2014-06-20 16:36:41 +02:00
parent 3847be89fa
commit d3de99eb1e
2 changed files with 0 additions and 40 deletions

View File

@ -195,15 +195,6 @@ QQuickItem *AppletQuickItemPrivate::createFullRepresentationItem()
return 0;
}
QQuickItem *graphicsObj = fullRepresentationItem;
QObject::connect(graphicsObj, &QQuickItem::widthChanged, [ = ]() {
fullRepresentationResizeTimer.start();
});
QObject::connect(graphicsObj, &QQuickItem::heightChanged, [ = ]() {
fullRepresentationResizeTimer.start();
});
emit q->fullRepresentationItemChanged(fullRepresentationItem);
return fullRepresentationItem;
@ -390,18 +381,6 @@ AppletQuickItem::AppletQuickItem(Plasma::Applet *applet, QQuickItem *parent)
connect(&d->compactRepresentationCheckTimer, SIGNAL(timeout()),
this, SLOT(compactRepresentationCheck()));
d->fullRepresentationResizeTimer.setSingleShot(true);
d->fullRepresentationResizeTimer.setInterval(250);
connect(&d->fullRepresentationResizeTimer, &QTimer::timeout,
[ = ]() {
if (!d->applet->isContainment()) {
KConfigGroup cg = d->applet->config();
cg = KConfigGroup(&cg, "PopupApplet");
cg.writeEntry("DialogWidth", d->fullRepresentationItem->width());
cg.writeEntry("DialogHeight", d->fullRepresentationItem->height());
}
});
d->qmlObject = new KDeclarative::QmlObject(this);
d->qmlObject->setTranslationDomain("plasma_applet_" + applet->pluginInfo().pluginName());
d->qmlObject->setInitializationDelayed(true);
@ -505,15 +484,6 @@ void AppletQuickItem::init()
d->fullRepresentation = d->qmlObject->mainComponent();
d->fullRepresentationItem = qobject_cast<QQuickItem*>(d->qmlObject->rootObject());
if (d->qmlObject->rootObject()) {
QQuickItem *graphicsObj = d->fullRepresentationItem;
QObject::connect(graphicsObj, &QQuickItem::widthChanged, [ = ]() {
d->fullRepresentationResizeTimer.start();
});
QObject::connect(graphicsObj, &QQuickItem::heightChanged, [ = ]() {
d->fullRepresentationResizeTimer.start();
});
}
emit fullRepresentationChanged(d->fullRepresentation);
}
@ -654,15 +624,6 @@ void AppletQuickItem::setExpanded(bool expanded)
d->createCompactRepresentationExpanderItem();
}
KConfigGroup cg = d->applet->config();
cg = KConfigGroup(&cg, "PopupApplet");
const int width = cg.readEntry("DialogWidth", -1);
const int height = cg.readEntry("DialogHeight", -1);
if (width > 0 && height > 0) {
d->fullRepresentationItem->setWidth(width);
d->fullRepresentationItem->setHeight(height);
}
if (d->compactRepresentationExpanderItem) {
d->compactRepresentationExpanderItem->setProperty("fullRepresentation", QVariant::fromValue<QObject*>(d->createFullRepresentationItem()));
} else {

View File

@ -93,7 +93,6 @@ public:
QPointer<QObject> ownLayout;
QTimer compactRepresentationCheckTimer;
QTimer fullRepresentationResizeTimer;
Plasma::Applet *applet;
KDeclarative::QmlObject *qmlObject;