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

List:       kde-devel
Subject:    Small kicker panel menu bug
From:       Rob Kaper <cap () capsi ! com>
Date:       2001-05-21 15:14:02
[Download RAW message or body]

Can someone verify the attached patch so I can commit it after unfreeze?

It should solve a small bug in the kicker panel menu. There is some code to
avoid adding empty groups, but this does not work when a group contains
subgroups which are empty.

Reproduce:
Upon a clean kdebase install, there's applnk/Games, applnk/Games/Arcade
etcetera. All the subgroups of Games are empty when kappfinder finds
nothing, so they are not shown. Games itself however does get shown because
it has a couple of entries - the not-shown subgroups!

Rob
-- 
Rob Kaper     | 'What? In riddles?' said Gandalf. 'No! For I was talking
cap@capsi.com | aloud to myself. A habit of the old: they choose the wisest
www.capsi.com | person present to speak to; the long explanations needed by
              | the young are wearying.' - "Lord of the Rings", JRR Tolkien

["kmenu.diff" (text/plain)]

Index: service_mnu.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/ui/service_mnu.cpp,v
retrieving revision 1.23
diff -u -r1.23 service_mnu.cpp
--- service_mnu.cpp	2001/03/04 20:27:20	1.23
+++ service_mnu.cpp	2001/05/21 15:12:25
@@ -233,6 +233,11 @@
             PanelServiceMenu * m =
                 newSubMenu(g->name(), g->relPath(), this, g->name().utf8());
 	    m->setCaption( groupCaption );
+
+            // Avoid adding empty submenus.
+            if (m->subMenus.count() == 0)
+                continue;
+
             int newId = insertItem(SmallIconSet(g->icon()), groupCaption, m, id++);
             entryMap_.insert(newId, static_cast<KSharedPtr<KSycocaEntry> >(g));
             // We have to delete the sub menu our selves! (See Qt docs.)

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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