mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
Revert "CMenuForwarder: Use std::string (not pointer to std::string or char) for option"
This reverts commit b5d1322617
.
This commit is contained in:
@@ -1598,7 +1598,8 @@ int CMenuOptionLanguageChooser::paint( bool selected )
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------
|
||||||
CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
|
CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
|
||||||
{
|
{
|
||||||
option = (Option != NULL) ? (std::string)Option : "";
|
option = Option;
|
||||||
|
option_string = NULL;
|
||||||
text=Text;
|
text=Text;
|
||||||
active = Active;
|
active = Active;
|
||||||
jumpTarget = Target;
|
jumpTarget = Target;
|
||||||
@@ -1610,7 +1611,8 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active,
|
|||||||
|
|
||||||
CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
|
CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
|
||||||
{
|
{
|
||||||
option = Option;
|
option = NULL;
|
||||||
|
option_string = &Option;
|
||||||
text=Text;
|
text=Text;
|
||||||
active = Active;
|
active = Active;
|
||||||
jumpTarget = Target;
|
jumpTarget = Target;
|
||||||
@@ -1650,8 +1652,10 @@ int CMenuForwarder::getWidth(void)
|
|||||||
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(text), true);
|
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(text), true);
|
||||||
const char * option_text = NULL;
|
const char * option_text = NULL;
|
||||||
|
|
||||||
if (!option.empty())
|
if (option)
|
||||||
option_text = option.c_str();
|
option_text = option;
|
||||||
|
else if (option_string)
|
||||||
|
option_text = option_string->c_str();
|
||||||
|
|
||||||
|
|
||||||
if (option_text != NULL)
|
if (option_text != NULL)
|
||||||
@@ -1674,10 +1678,13 @@ int CMenuForwarder::exec(CMenuTarget* parent)
|
|||||||
|
|
||||||
const char * CMenuForwarder::getOption(void)
|
const char * CMenuForwarder::getOption(void)
|
||||||
{
|
{
|
||||||
if (!option.empty())
|
if (option)
|
||||||
return option.c_str();
|
return option;
|
||||||
else
|
else
|
||||||
return NULL;
|
if (option_string)
|
||||||
|
return option_string->c_str();
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * CMenuForwarder::getName(void)
|
const char * CMenuForwarder::getName(void)
|
||||||
@@ -1749,8 +1756,10 @@ int CMenuForwarderNonLocalized::getWidth(void)
|
|||||||
{
|
{
|
||||||
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(the_text, true);
|
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(the_text, true);
|
||||||
const char * option_text = NULL;
|
const char * option_text = NULL;
|
||||||
if (!option.empty())
|
if (option)
|
||||||
option_text = option.c_str();
|
option_text = option;
|
||||||
|
else if (option_string)
|
||||||
|
option_text = option_string->c_str();
|
||||||
|
|
||||||
if (option_text != NULL)
|
if (option_text != NULL)
|
||||||
tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_text, true);
|
tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_text, true);
|
||||||
|
@@ -198,7 +198,8 @@ class CMenuForwarder : public CMenuItem
|
|||||||
std::string actionKey;
|
std::string actionKey;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string option;
|
const char * option;
|
||||||
|
const std::string * option_string;
|
||||||
CMenuTarget * jumpTarget;
|
CMenuTarget * jumpTarget;
|
||||||
neutrino_locale_t text;
|
neutrino_locale_t text;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user