Remove unneeded casts
They're all because we're accessing the d-pointer of the parent class (!), we can access it without casting.
This commit is contained in:
parent
459f81814d
commit
f5f96c1390
|
@ -411,8 +411,8 @@ void Containment::addApplet(Applet *applet)
|
||||||
|
|
||||||
if (!applet->d->uiReady) {
|
if (!applet->d->uiReady) {
|
||||||
d->loadingApplets << applet;
|
d->loadingApplets << applet;
|
||||||
if (static_cast<Applet *>(this)->d->uiReady) {
|
if (Applet::d->uiReady) {
|
||||||
static_cast<Applet *>(this)->d->uiReady = false;
|
Applet::d->uiReady = false;
|
||||||
emit uiReadyChanged(false);
|
emit uiReadyChanged(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,8 +536,7 @@ QHash<QString, ContainmentActions *> &Containment::containmentActions()
|
||||||
|
|
||||||
bool Containment::isUiReady() const
|
bool Containment::isUiReady() const
|
||||||
{
|
{
|
||||||
const Applet *a = static_cast<const Applet *>(this);
|
return Applet::d->uiReady && Applet::d->started;
|
||||||
return a->d->uiReady && a->d->started;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Containment::setActivity(const QString &activityId)
|
void Containment::setActivity(const QString &activityId)
|
||||||
|
|
|
@ -315,11 +315,10 @@ void AppletPrivate::setUiReady()
|
||||||
c = q->containment();
|
c = q->containment();
|
||||||
if (c) {
|
if (c) {
|
||||||
c->d->loadingApplets.remove(q);
|
c->d->loadingApplets.remove(q);
|
||||||
Applet *a = qobject_cast<Applet *>(c);
|
|
||||||
Q_ASSERT(a);
|
if (c->d->loadingApplets.isEmpty() && !Applet::d->uiReady) {
|
||||||
if (c->d->loadingApplets.isEmpty() && a && !a->d->uiReady) {
|
c->Applet::d->uiReady = true;
|
||||||
a->d->uiReady = true;
|
if (Applet::d->started) {
|
||||||
if (a->d->started) {
|
|
||||||
emit c->uiReadyChanged(true);
|
emit c->uiReadyChanged(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user