Figure out why my plasma wasn't notifying the startup
Make sure AppletPrivate::uiReady is set in applet_p.cpp when we report that the ui is ready. Make sure that if we loop through all the containments and they're all ready, we emit that it's done. So far, Corona::startupCompleted was never emitted. REVIEW: 119220
This commit is contained in:
parent
2f933387af
commit
dac1d8f265
@ -409,10 +409,10 @@ void Containment::addApplet(Applet *applet)
|
|||||||
|
|
||||||
d->applets << applet;
|
d->applets << applet;
|
||||||
|
|
||||||
if (!applet->d->uiReady) {
|
if (!d->uiReady) {
|
||||||
d->loadingApplets << applet;
|
d->loadingApplets << applet;
|
||||||
if (Applet::d->uiReady) {
|
if (d->uiReady) {
|
||||||
Applet::d->uiReady = false;
|
d->uiReady = false;
|
||||||
emit uiReadyChanged(false);
|
emit uiReadyChanged(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -536,7 +536,7 @@ QHash<QString, ContainmentActions *> &Containment::containmentActions()
|
|||||||
|
|
||||||
bool Containment::isUiReady() const
|
bool Containment::isUiReady() const
|
||||||
{
|
{
|
||||||
return Applet::d->uiReady && Applet::d->started;
|
return d->uiReady && Applet::d->started;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Containment::setActivity(const QString &activityId)
|
void Containment::setActivity(const QString &activityId)
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "pluginloader.h"
|
#include "pluginloader.h"
|
||||||
#include "private/applet_p.h"
|
#include "private/applet_p.h"
|
||||||
#include "private/containment_p.h"
|
#include "private/containment_p.h"
|
||||||
|
#include "private/timetracker.h"
|
||||||
|
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
|
||||||
@ -54,6 +55,10 @@ Corona::Corona(QObject *parent)
|
|||||||
// qDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start";
|
// qDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start";
|
||||||
#endif
|
#endif
|
||||||
d->init();
|
d->init();
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
new Plasma::TimeTracker(this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Corona::~Corona()
|
Corona::~Corona()
|
||||||
@ -543,6 +548,10 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (containmentsStarting <= 0) {
|
||||||
|
emit q->startupCompleted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newContainments;
|
return newContainments;
|
||||||
|
@ -41,6 +41,8 @@ class CoronaPrivate;
|
|||||||
class PLASMA_EXPORT Corona : public QObject
|
class PLASMA_EXPORT Corona : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool isStartupCompleted READ isStartupCompleted NOTIFY startupCompleted)
|
||||||
|
Q_PROPERTY(Plasma::Package package READ package NOTIFY packageChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Corona(QObject *parent = 0);
|
explicit Corona(QObject *parent = 0);
|
||||||
|
@ -67,7 +67,6 @@ AppletPrivate::AppletPrivate(KService::Ptr service, const KPluginInfo *info, int
|
|||||||
needsConfig(false),
|
needsConfig(false),
|
||||||
started(false),
|
started(false),
|
||||||
globalShortcutEnabled(false),
|
globalShortcutEnabled(false),
|
||||||
uiReady(false),
|
|
||||||
userConfiguring(false)
|
userConfiguring(false)
|
||||||
{
|
{
|
||||||
if (appletId == 0) {
|
if (appletId == 0) {
|
||||||
@ -309,27 +308,10 @@ void AppletPrivate::setUiReady()
|
|||||||
//am i the containment?
|
//am i the containment?
|
||||||
Containment *c = qobject_cast<Containment *>(q);
|
Containment *c = qobject_cast<Containment *>(q);
|
||||||
if (c && c->isContainment()) {
|
if (c && c->isContainment()) {
|
||||||
//if we are the containment and there is still some uncomplete applet, we're still incomplete
|
c->d->setUiReady();
|
||||||
if (!c->d->loadingApplets.isEmpty()) {
|
} else if (Containment* cc = q->containment()) {
|
||||||
return;
|
cc->d->appletLoaded(q);
|
||||||
} else if (!uiReady && started) {
|
|
||||||
emit c->uiReadyChanged(true);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
c = q->containment();
|
|
||||||
if (c) {
|
|
||||||
c->d->loadingApplets.remove(q);
|
|
||||||
|
|
||||||
if (c->d->loadingApplets.isEmpty() && !c->Applet::d->uiReady) {
|
|
||||||
c->Applet::d->uiReady = true;
|
|
||||||
if (c->Applet::d->started) {
|
|
||||||
emit c->uiReadyChanged(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uiReady = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// put all setup routines for script here. at this point we can assume that
|
// put all setup routines for script here. at this point we can assume that
|
||||||
@ -375,9 +357,8 @@ void AppletPrivate::scheduleConstraintsUpdate(Plasma::Types::Constraints c)
|
|||||||
|
|
||||||
if (c & Plasma::Types::StartupCompletedConstraint) {
|
if (c & Plasma::Types::StartupCompletedConstraint) {
|
||||||
started = true;
|
started = true;
|
||||||
if (uiReady) {
|
if (q->isContainment())
|
||||||
emit q->containment()->uiReadyChanged(true);
|
qobject_cast<Containment*>(q)->d->setStarted();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingConstraints |= c;
|
pendingConstraints |= c;
|
||||||
|
@ -111,7 +111,6 @@ public:
|
|||||||
bool needsConfig : 1;
|
bool needsConfig : 1;
|
||||||
bool started : 1;
|
bool started : 1;
|
||||||
bool globalShortcutEnabled : 1;
|
bool globalShortcutEnabled : 1;
|
||||||
bool uiReady : 1;
|
|
||||||
bool userConfiguring : 1;
|
bool userConfiguring : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ ContainmentPrivate::ContainmentPrivate(Containment *c):
|
|||||||
formFactor(Types::Planar),
|
formFactor(Types::Planar),
|
||||||
location(Types::Floating),
|
location(Types::Floating),
|
||||||
lastScreen(-1), // never had a screen
|
lastScreen(-1), // never had a screen
|
||||||
type(Plasma::Types::NoContainmentType)
|
type(Plasma::Types::NoContainmentType),
|
||||||
|
uiReady(false)
|
||||||
{
|
{
|
||||||
//if the parent is an applet (i.e we are the systray)
|
//if the parent is an applet (i.e we are the systray)
|
||||||
//we want to follow screen changed signals from the parent's containment
|
//we want to follow screen changed signals from the parent's containment
|
||||||
@ -228,4 +229,36 @@ bool ContainmentPrivate::isPanelContainment() const
|
|||||||
return type == Plasma::Types::PanelContainment || type == Plasma::Types::CustomPanelContainment;
|
return type == Plasma::Types::PanelContainment || type == Plasma::Types::CustomPanelContainment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContainmentPrivate::setStarted()
|
||||||
|
{
|
||||||
|
if (!q->Applet::d->started) {
|
||||||
|
q->Applet::d->started = true;
|
||||||
|
|
||||||
|
if (uiReady)
|
||||||
|
emit q->uiReadyChanged(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ContainmentPrivate::setUiReady()
|
||||||
|
{
|
||||||
|
//if we are the containment and there is still some uncomplete applet, we're still incomplete
|
||||||
|
if (!uiReady && loadingApplets.isEmpty()) {
|
||||||
|
uiReady = true;
|
||||||
|
if (q->Applet::d->started)
|
||||||
|
emit q->uiReadyChanged(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ContainmentPrivate::appletLoaded(Applet* applet)
|
||||||
|
{
|
||||||
|
loadingApplets.remove(q);
|
||||||
|
|
||||||
|
if (loadingApplets.isEmpty() && !uiReady) {
|
||||||
|
uiReady = true;
|
||||||
|
if (q->Applet::d->started) {
|
||||||
|
emit q->uiReadyChanged(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,6 @@ class ContainmentPrivate
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ContainmentPrivate(Containment *c);
|
ContainmentPrivate(Containment *c);
|
||||||
|
|
||||||
|
|
||||||
~ContainmentPrivate();
|
~ContainmentPrivate();
|
||||||
|
|
||||||
void triggerShowAddWidgets();
|
void triggerShowAddWidgets();
|
||||||
@ -60,7 +58,6 @@ public:
|
|||||||
void containmentConstraintsEvent(Plasma::Types::Constraints constraints);
|
void containmentConstraintsEvent(Plasma::Types::Constraints constraints);
|
||||||
|
|
||||||
bool isPanelContainment() const;
|
bool isPanelContainment() const;
|
||||||
void setLockToolText();
|
|
||||||
void appletDeleted(Applet *);
|
void appletDeleted(Applet *);
|
||||||
void configChanged();
|
void configChanged();
|
||||||
|
|
||||||
@ -78,6 +75,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void addDefaultActions(KActionCollection *actions, Containment *c = 0);
|
static void addDefaultActions(KActionCollection *actions, Containment *c = 0);
|
||||||
|
|
||||||
|
void setUiReady();
|
||||||
|
void setStarted();
|
||||||
|
void appletLoaded(Applet* applet);
|
||||||
|
|
||||||
Containment *q;
|
Containment *q;
|
||||||
Types::FormFactor formFactor;
|
Types::FormFactor formFactor;
|
||||||
Types::Location location;
|
Types::Location location;
|
||||||
@ -89,6 +90,7 @@ public:
|
|||||||
int lastScreen;
|
int lastScreen;
|
||||||
QString activityId;
|
QString activityId;
|
||||||
Types::ContainmentType type;
|
Types::ContainmentType type;
|
||||||
|
bool uiReady : 1;
|
||||||
|
|
||||||
static const char defaultWallpaper[];
|
static const char defaultWallpaper[];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user