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

List:       kde-commits
Subject:    KDE/kdelibs/plasma/private
From:       Marco Martin <notmart () gmail ! com>
Date:       2010-07-07 15:59:02
Message-ID: 20100707155902.78F48AC85D () svn ! kde ! org
[Download RAW message or body]

SVN commit 1147196 by mart:

be sure to not insert the same action two times


 M  +4 -0      desktoptoolbox.cpp  
 M  +5 -0      internaltoolbox.cpp  
 M  +2 -0      internaltoolbox_p.h  


--- trunk/KDE/kdelibs/plasma/private/desktoptoolbox.cpp #1147195:1147196
@@ -544,6 +544,10 @@
         return;
     }
 
+    if (actions().contains(action)) {
+        return;
+    }
+
     InternalToolBox::addTool(action);
     Plasma::IconWidget *tool = new Plasma::IconWidget(toolParent());
 
--- trunk/KDE/kdelibs/plasma/private/internaltoolbox.cpp #1147195:1147196
@@ -116,6 +116,11 @@
     return this;
 }
 
+QList<QAction *> InternalToolBox::actions() const
+{
+    return d->actions;
+}
+
 void InternalToolBox::addTool(QAction *action)
 {
     if (!action) {
--- trunk/KDE/kdelibs/plasma/private/internaltoolbox_p.h #1147195:1147196
@@ -95,6 +95,8 @@
     virtual void showToolBox() = 0;
     virtual void hideToolBox() = 0;
 
+    QList<QAction *> actions() const;
+
 protected:
     Containment *containment();
     QPoint toolPosition(int toolHeight);
[prev in list] [next in list] [prev in thread] [next in thread] 

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