From ab99a3a048c985494f76a08af37bf6721b2f4cf5 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 22 Oct 2010 19:52:05 +0000 Subject: [PATCH] moderately less ugly svn path=/trunk/KDE/kdelibs/; revision=1188638 --- private/actionwidgetinterface_p.h | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/private/actionwidgetinterface_p.h b/private/actionwidgetinterface_p.h index 59ce0671d..8d82de034 100644 --- a/private/actionwidgetinterface_p.h +++ b/private/actionwidgetinterface_p.h @@ -31,8 +31,6 @@ template class ActionWidgetInterface : public ThemedWidgetInterface { public: - QAction *action; - ActionWidgetInterface(T *parent) : ThemedWidgetInterface(parent), action(0) @@ -57,20 +55,20 @@ public: void syncToAction() { if (!action) { - ThemedWidgetInterface::q->setIcon(QIcon()); - ThemedWidgetInterface::q->setText(QString()); - ThemedWidgetInterface::q->setEnabled(false); + this->q->setIcon(QIcon()); + this->q->setText(QString()); + this->q->setEnabled(false); return; } //we don't get told *what* changed, just that something changed //so we update everything we care about - ThemedWidgetInterface::q->setIcon(action->icon()); - ThemedWidgetInterface::q->setText(action->iconText()); - ThemedWidgetInterface::q->setEnabled(action->isEnabled()); - ThemedWidgetInterface::q->setVisible(action->isVisible()); + this->q->setIcon(action->icon()); + this->q->setText(action->iconText()); + this->q->setEnabled(action->isEnabled()); + this->q->setVisible(action->isVisible()); - if (!ThemedWidgetInterface::q->toolTip().isEmpty()) { - ThemedWidgetInterface::q->setToolTip(action->text()); + if (!this->q->toolTip().isEmpty()) { + this->q->setToolTip(action->text()); } changed(); @@ -79,19 +77,21 @@ public: void setAction(QAction *a) { if (action) { - QObject::disconnect(action, 0, ThemedWidgetInterface::q, 0); - QObject::disconnect(ThemedWidgetInterface::q, 0, action, 0); + QObject::disconnect(action, 0, this->q, 0); + QObject::disconnect(this->q, 0, action, 0); } action = a; if (action) { - QObject::connect(action, SIGNAL(changed()), ThemedWidgetInterface::q, SLOT(syncToAction())); - QObject::connect(action, SIGNAL(destroyed(QObject*)), ThemedWidgetInterface::q, SLOT(clearAction())); - QObject::connect(ThemedWidgetInterface::q, SIGNAL(clicked()), action, SLOT(trigger())); + QObject::connect(action, SIGNAL(changed()), this->q, SLOT(syncToAction())); + QObject::connect(action, SIGNAL(destroyed(QObject*)), this->q, SLOT(clearAction())); + QObject::connect(this->q, SIGNAL(clicked()), action, SLOT(trigger())); syncToAction(); } } + + QAction *action; }; } // namespace Plasma