AppletQuickItem: Drop timer to create full representation

The timer only added 250ms delay before creating the full representation,
sometimes resulting in showing empty popup for a moment.

REVIEW: 126468
This commit is contained in:
David Rosca 2015-12-22 15:46:00 +01:00
parent 283ab4a634
commit 344dbeb938
3 changed files with 2 additions and 10 deletions

View File

@ -407,11 +407,6 @@ AppletQuickItem::AppletQuickItem(Plasma::Applet *applet, QQuickItem *parent)
d->containmentPackage = d->applet->containment()->package();
}
d->compactRepresentationCheckTimer.setSingleShot(true);
d->compactRepresentationCheckTimer.setInterval(250);
connect(&d->compactRepresentationCheckTimer, SIGNAL(timeout()),
this, SLOT(compactRepresentationCheck()));
if (applet->pluginInfo().isValid()) {
const QString rootPath = applet->pluginInfo().property(QStringLiteral("X-Plasma-RootPath")).toString();
if (!rootPath.isEmpty()) {
@ -582,7 +577,7 @@ void AppletQuickItem::init()
//HACK: check the Layout properties we wrote
QQmlProperty p(this, "Layout.minimumWidth", QtQml::qmlContext(d->qmlObject->rootObject()));
d->compactRepresentationCheckTimer.start();
d->compactRepresentationCheck();
qmlObject()->engine()->rootContext()->setBaseUrl(qmlObject()->source());
qmlObject()->engine()->setContextForObject(this, qmlObject()->engine()->rootContext());
}
@ -746,7 +741,7 @@ void AppletQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &o
Q_UNUSED(oldGeometry)
QQuickItem::geometryChanged(newGeometry, oldGeometry);
d->compactRepresentationCheckTimer.start();
d->compactRepresentationCheck();
}
void AppletQuickItem::itemChange(ItemChange change, const ItemChangeData &value)

View File

@ -152,7 +152,6 @@ protected:
private:
AppletQuickItemPrivate *const d;
Q_PRIVATE_SLOT(d, void compactRepresentationCheck())
Q_PRIVATE_SLOT(d, void minimumWidthChanged())
Q_PRIVATE_SLOT(d, void minimumHeightChanged())
Q_PRIVATE_SLOT(d, void preferredWidthChanged())

View File

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