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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/actions
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2009-08-09 14:49:48
Message-ID: 1249829388.138585.3756.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1009265 by cfeck:

Fix disabled actions selectable in combo box

CCBUG: 203114


 M  +9 -0      kselectaction.cpp  


--- trunk/KDE/kdelibs/kdeui/actions/kselectaction.cpp #1009264:1009265
@@ -36,6 +36,7 @@
 #include <QEvent>
 #include <QToolButton>
 #include <QToolBar>
+#include <QStandardItem>
 #include <kicon.h>
 #include <kdebug.h>
 
@@ -688,6 +689,10 @@
       e->action()->icon(),
       ::DropAmpersands (e->action()->text()),
       QVariantFromQAction (e->action ()));
+    if (QStandardItemModel *model = qobject_cast<QStandardItemModel *>(comboBox->model())) {
+        QStandardItem *item = model->item(index);
+        item->setEnabled(e->action()->isEnabled());
+    }
 
     // Inserting an item into a combobox can change the current item so
     // make sure the item corresponding to the checked action is selected.
@@ -710,6 +715,10 @@
     //          << endl;
     comboBox->setItemIcon (index, e->action ()->icon ());
     comboBox->setItemText (index, ::DropAmpersands (e->action ()->text ()));
+    if (QStandardItemModel *model = qobject_cast<QStandardItemModel *>(comboBox->model())) {
+        QStandardItem *item = model->item(index);
+        item->setEnabled(e->action()->isEnabled());
+    }
 
     // The checked action may have become unchecked so
     // make sure the item corresponding to the checked action is selected.
[prev in list] [next in list] [prev in thread] [next in thread] 

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