mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +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)
|
||||
{
|
||||
if (cch_btn_obj){
|
||||
delete cch_btn_obj;
|
||||
cch_btn_obj = NULL;
|
||||
}
|
||||
v_cch_btn.push_back(button_name);
|
||||
initCCHeaderButtons();
|
||||
}
|
||||
|
||||
void CComponentsHeader::removeHeaderButtons()
|
||||
{
|
||||
v_cch_btn.clear();
|
||||
if (cch_btn_obj)
|
||||
cch_btn_obj->removeAllIcons();
|
||||
if (cch_btn_obj){
|
||||
delete cch_btn_obj;
|
||||
cch_btn_obj = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentsHeader::initCCHDefaultButtons()
|
||||
|
Reference in New Issue
Block a user