Diff of /libgui/MenuGroup.cpp [45d3b7] .. [99b84b] Maximize Restore

  Switch to side-by-side view

--- a/libgui/MenuGroup.cpp
+++ b/libgui/MenuGroup.cpp
@@ -1,6 +1,6 @@
 /***************************************************************************
-                          MenuGroup.cpp  -  description
-                             -------------------
+			  MenuGroup.cpp  -  description
+			     -------------------
     begin                : Mon Jan 10 2000
     copyright            : (C) 2000 by Thomas Eschenbacher
     email                : Thomas.Eschenbacher@gmx.de
@@ -32,6 +32,12 @@
 MenuGroup::~MenuGroup()
 {
     clear();
+
+    QDict<MenuNode> *group_list = getGroupList();
+
+    if (group_list && (group_list->find(getName()) != 0)) {
+	group_list->remove(getName());
+    }
 }
 
 //*****************************************************************************
@@ -44,7 +50,7 @@
     // notification for the childs that our enable state changed
     QObject::connect(
 	this, SIGNAL(sigParentEnableChanged()),
-	child, SLOT(slotParentEnableChanged())    	
+	child, SLOT(slotParentEnableChanged())
     );
 
     return child->getId();
@@ -53,12 +59,15 @@
 //*****************************************************************************
 void MenuGroup::removeChild(MenuNode *child)
 {
+    if (!child) return;
+
     int index = children.find(child);
     if (index != -1) {
+//	debug("MenuGroup::removeChild(%s)",child->getName());
 	// notification for the childs that our enable state changed
 	QObject::disconnect(
 	    this, SIGNAL(sigParentEnableChanged()),
-	    child, SLOT(slotParentEnableChanged())    	
+	    child, SLOT(slotParentEnableChanged())
 	);
 
 	children.setAutoDelete(false);
@@ -88,10 +97,10 @@
     while (child) {
 	int pos = children.at();
 	if (strcmp(child->getUID(), uid) == 0)
-	    new_selection = child; // new selected child found !
+	    new_selection = child;    // new selected child found !
 	else
-	    child->setChecked(false); // remove check from others
-	
+	    child->setChecked(false);    // remove check from others
+
 	children.at(pos);
 	child = children.next();
     }