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

List:       kde-commits
Subject:    branches/KDE/4.1/kdebase/workspace/plasma/applets/kickoff/simpleapplet
From:       Alex Merry <kde () randomguy3 ! me ! uk>
Date:       2008-08-27 20:16:46
Message-ID: 1219868206.960554.3909.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 853529 by alexmerry:

Fill the submenus up front, rather than on demand, so that they can be placed correctly.

CCBUG: 166847



 M  +6 -21     menuview.cpp  
 M  +0 -2      menuview.h  


--- branches/KDE/4.1/kdebase/workspace/plasma/applets/kickoff/simpleapplet/menuview.cpp #853528:853529
@@ -60,8 +60,13 @@
             KMenu *childMenu = new KMenu(parent);
             childMenu->installEventFilter(q);
 
-            QObject::connect(childMenu, SIGNAL(aboutToShow()), q, SLOT(fillSubMenu()));
             action = childMenu->menuAction();
+
+            if (model->canFetchMore(index)) {
+                model->fetchMore(index);
+            }
+
+            buildBranch(childMenu, index);
         } else {
             action = q->createLeafAction(index,parent);
         }
@@ -354,26 +359,6 @@
     setModel(d->model);
 }
 
-void MenuView::fillSubMenu()
-{
-    Q_ASSERT(d->model);
-
-    QMenu *subMenu = qobject_cast<QMenu*>(sender());
-    Q_ASSERT(subMenu);
-    Q_ASSERT(subMenu->isEmpty());
-
-    disconnect(subMenu, SIGNAL(aboutToShow()), this, SLOT(fillSubMenu()));
-
-    QModelIndex menuIndex = indexForAction(subMenu->menuAction());
-    Q_ASSERT(menuIndex.isValid());
-
-    if (d->model->canFetchMore(menuIndex)) {
-        d->model->fetchMore(menuIndex);
-    }
-
-    d->buildBranch(subMenu, menuIndex);
-}
-
 void MenuView::setColumn(int column)
 {
     d->column = column;
--- branches/KDE/4.1/kdebase/workspace/plasma/applets/kickoff/simpleapplet/menuview.h #853528:853529
@@ -143,8 +143,6 @@
     void dataChanged(const QModelIndex& topLeft,const QModelIndex& bottomRight);
     // the model did reset itself and all items are invalid
     void modelReset();
-    // performs on-demand filling of sub-menus in the tree
-    void fillSubMenu();
 
 private:
     class Private;
[prev in list] [next in list] [prev in thread] [next in thread] 

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