From f45246caedbf9518ea0284f00f81f5926a0fddbf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 30 Aug 2012 22:48:40 +0200 Subject: [PATCH] CComponentsTitleBar: rename member addText(), convert locale in constructor --- src/gui/components/cc.h | 2 +- src/gui/components/components.cpp | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 2af658632..d158a1597 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -371,7 +371,7 @@ class CComponentsTitleBar : public CComponentsItemBox neutrino_locale_t tb_locale_text; int tb_text_align; - bool addText(); + bool initText(); void initVarTitleBar(); public: diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index 64bf92a38..6ed6e9c90 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -1209,7 +1209,7 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const tb_c_text = c_text; tb_text_align = text_alignment; - if (addText()) + if (initText()) calculateElements(); } @@ -1231,7 +1231,7 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const tb_s_text = s_text; tb_text_align = text_alignment; - if (addText()) + if (initText()) calculateElements(); } @@ -1251,13 +1251,14 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const //CComponentsTitleBar tb_locale_text = locale_text; + tb_s_text = g_Locale->getText(tb_locale_text); tb_text_align = text_alignment; - if (addText()) + if (initText()) calculateElements(); } -bool CComponentsTitleBar::addText() +bool CComponentsTitleBar::initText() { if (tb_c_text){ addElement (tb_text_align, CC_ITEMBOX_TEXT, tb_c_text); @@ -1267,10 +1268,6 @@ bool CComponentsTitleBar::addText() addElement (tb_text_align, CC_ITEMBOX_TEXT, tb_s_text); return true; } - else if (tb_locale_text != NONEXISTANT_LOCALE){ - addElement (tb_text_align, CC_ITEMBOX_TEXT, g_Locale->getText(tb_locale_text)); - return true; - } else return false; }