Bug 114023 - removing applets from menubar via "Remove from Menubar"->"Applet"->"foo bar" removes wrong applet
Summary: removing applets from menubar via "Remove from Menubar"->"Applet"->"foo bar" ...
Status: RESOLVED FIXED
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.27.5
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-07 14:49 UTC by Michael Olbrich
Modified: 2023-12-28 19:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Olbrich 2005-10-07 14:49:06 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

I have a MacOS style menubar with several applets on it. When I tried to remove  one of the applets via "Remove from Menubar"->"Applet"->"foo bar" but another one was removed. Some facts that might help:
- The applet I tried to remove was the last one added.
- I removed several applets while trying to the move the one applet.
- when only two where left the same action had no effect any more.
- trying to remove the other one resulted in removing the one I originally wanted to remove.

svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdebase/kicker
At revision 468212.
Comment 1 Aaron J. Seigo 2005-10-07 21:28:10 UTC
SVN commit 468345 by aseigo:

remove the correct applet even when only some are immutable
BUG:114023


 M  +5 -3      removeapplet_mnu.cpp  


--- branches/KDE/3.5/kdebase/kicker/kicker/ui/removeapplet_mnu.cpp #468344:468345
@@ -52,19 +52,21 @@
     QValueList<PanelMenuItemInfo> items;
 
     for (BaseContainer::List::const_iterator it = m_containers.constBegin();
-         it != m_containers.constEnd();
-         ++it)
+         it != m_containers.constEnd();)
     {
         BaseContainer* container = *it;
         if (container->isImmutable())
         {
+            it = ++it;
+            m_containers.remove(container);
             continue;
         }
 
         items.append(PanelMenuItemInfo(container->icon(),
                                        container->visibleName().replace("&", "&&"),
                                        id));
-        id++;
+        ++id;
+        ++it;
     }
 
     qHeapSort(items);