mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-14 17:03:34 +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.
Origin commit data
------------------
Commit: 9150088088
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-11-25 (Sun, 25 Nov 2012)
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