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:
Aleix Pol 2014-07-09 18:20:32 +02:00
parent 459f81814d
commit f5f96c1390
2 changed files with 7 additions and 9 deletions

View File

@ -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)

View File

@ -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);
} }
} }