mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
src/gui/widget/stringinput.cpp: copy valueString to value in ::exec,
to follow extenal valueString updates
Origin commit data
------------------
Commit: 22138336d4
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-11-01 (Fri, 01 Nov 2013)
This commit is contained in:
@@ -84,9 +84,12 @@ CStringInput::CStringInput(const neutrino_locale_t Name, std::string* Value, int
|
||||
{
|
||||
name = Name;
|
||||
head = NULL;
|
||||
value = NULL;
|
||||
#if 0
|
||||
value = new char[Size+1];
|
||||
value[Size] = '\0';
|
||||
strncpy(value,Value->c_str(),Size);
|
||||
#endif
|
||||
valueString = Value;
|
||||
lower_bound = -1;
|
||||
upper_bound = -1;
|
||||
@@ -121,10 +124,12 @@ CStringInput::CStringInput(char * Head, char* Value, int Size, const neutrino_lo
|
||||
|
||||
CStringInput::~CStringInput()
|
||||
{
|
||||
#if 0
|
||||
if (valueString != NULL)
|
||||
{
|
||||
delete[] value;
|
||||
}
|
||||
#endif
|
||||
if(head) {
|
||||
free(head);
|
||||
}
|
||||
@@ -379,6 +384,11 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
||||
delete[] oldval;
|
||||
return res;
|
||||
}
|
||||
if (valueString != NULL) {
|
||||
value = new char[size+1];
|
||||
value[size] = '\0';
|
||||
strncpy(value,valueString->c_str(),size);
|
||||
}
|
||||
oldval[size] = 0;
|
||||
dispval[size] = 0;
|
||||
|
||||
@@ -531,6 +541,9 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
|
||||
{
|
||||
observ->changeNotify(name, value);
|
||||
}
|
||||
if (valueString != NULL)
|
||||
delete[] value;
|
||||
|
||||
delete[] dispval;
|
||||
delete[] oldval;
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user