[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/plasma/private
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2010-10-22 19:52:06
Message-ID: 20101022195206.0F76AAC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1188638 by aseigo:

moderately less ugly


 M  +16 -16    actionwidgetinterface_p.h  


--- trunk/KDE/kdelibs/plasma/private/actionwidgetinterface_p.h #1188637:1188638
@@ -31,8 +31,6 @@
 class ActionWidgetInterface : public ThemedWidgetInterface<T>
 {
 public:
-    QAction *action;
-
     ActionWidgetInterface(T *parent)
         : ThemedWidgetInterface<T>(parent),
           action(0)
@@ -57,20 +55,20 @@
     void syncToAction()
     {
         if (!action) {
-            ThemedWidgetInterface<T>::q->setIcon(QIcon());
-            ThemedWidgetInterface<T>::q->setText(QString());
-            ThemedWidgetInterface<T>::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<T>::q->setIcon(action->icon());
-        ThemedWidgetInterface<T>::q->setText(action->iconText());
-        ThemedWidgetInterface<T>::q->setEnabled(action->isEnabled());
-        ThemedWidgetInterface<T>::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<T>::q->toolTip().isEmpty()) {
-            ThemedWidgetInterface<T>::q->setToolTip(action->text());
+        if (!this->q->toolTip().isEmpty()) {
+            this->q->setToolTip(action->text());
         }
 
         changed();
@@ -79,19 +77,21 @@
     void setAction(QAction *a)
     {
         if (action) {
-            QObject::disconnect(action, 0, ThemedWidgetInterface<T>::q, 0);
-            QObject::disconnect(ThemedWidgetInterface<T>::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<T>::q, \
                SLOT(syncToAction()));
-            QObject::connect(action, SIGNAL(destroyed(QObject*)), \
                ThemedWidgetInterface<T>::q, SLOT(clearAction()));
-            QObject::connect(ThemedWidgetInterface<T>::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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic