mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-18 10:51:12 +02:00
CComponentsHeader: fix broken addHeaderButton() and removeHeaderButtons()
Simple push_back() has no effect, buttons must be initialized and destroy of cch_btn_obj is an easy way for clean up.
This commit is contained in:
@@ -1826,14 +1826,21 @@ void CComponentsHeader::initCCHeaderIcon()
|
|||||||
|
|
||||||
void CComponentsHeader::addHeaderButton(const std::string& button_name)
|
void CComponentsHeader::addHeaderButton(const std::string& button_name)
|
||||||
{
|
{
|
||||||
|
if (cch_btn_obj){
|
||||||
|
delete cch_btn_obj;
|
||||||
|
cch_btn_obj = NULL;
|
||||||
|
}
|
||||||
v_cch_btn.push_back(button_name);
|
v_cch_btn.push_back(button_name);
|
||||||
|
initCCHeaderButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsHeader::removeHeaderButtons()
|
void CComponentsHeader::removeHeaderButtons()
|
||||||
{
|
{
|
||||||
v_cch_btn.clear();
|
v_cch_btn.clear();
|
||||||
if (cch_btn_obj)
|
if (cch_btn_obj){
|
||||||
cch_btn_obj->removeAllIcons();
|
delete cch_btn_obj;
|
||||||
|
cch_btn_obj = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsHeader::initCCHDefaultButtons()
|
void CComponentsHeader::initCCHDefaultButtons()
|
||||||
|
Reference in New Issue
Block a user