From kde-commits Sun Mar 02 18:41:33 2003 From: Joseph Wenninger Date: Sun, 02 Mar 2003 18:41:33 +0000 To: kde-commits Subject: kdebase/konqueror/sidebar X-MARC-Message: https://marc.info/?l=kde-commits&m=104663057031868 CVS commit by jowenn: Don't crash if the configure button is removed from it's own menu M +16 -9 sidebar_widget.cpp 1.87 --- kdebase/konqueror/sidebar/sidebar_widget.cpp #1.86:1.87 @@ -455,5 +455,6 @@ void Sidebar_Widget::activatedMenu(int i if(showExtraButtons) { - ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); + ButtonBar->getButton(-1)->show(); +// ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); //JW - TEST ButtonBar->insertButton(SmallIcon("remove"),-2); //JW - TEST connect(ButtonBar->getButton(-2),SIGNAL(clicked(int)),partParent,SLOT(deleteLater())); @@ -464,6 +465,6 @@ void Sidebar_Widget::activatedMenu(int i i18n("You have hidden the navigation panel configuration button. To make it visible again, click the right mouse button on any of the navigation panel buttons and select \"Show Configuration Button\".")); - - ButtonBar->removeButton(-1); + ButtonBar->getButton(-1)->hide(); +// ButtonBar->removeButton(-1); //JW -TEST ButtonBar->removeButton(-2); } @@ -569,13 +570,19 @@ void Sidebar_Widget::createButtons() readConfig(); + if (!ButtonBar->getButton(-1)) ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); + if(showExtraButtons) - { - if (!ButtonBar->getButton(-1)) - { - ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); + ButtonBar->getButton(-1)->show(); + else + ButtonBar->getButton(-1)->hide(); + +// { +// if (!ButtonBar->getButton(-1)) +// { +// ButtonBar->appendButton(SmallIcon("configure"), -1, Menu, i18n("Configure Sidebar")); //JW - TEST ButtonBar->insertButton(SmallIcon("remove"),-2); //JW - TEST connect(ButtonBar->getButton(-2),SIGNAL(clicked(int)),partParent,SLOT(deleteLater())); - } - } +// } +// } }