diff options
-rw-r--r-- | common/rfb/Configuration.cxx | 6 | ||||
-rw-r--r-- | common/rfb/Configuration.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx index 6811a79b..e9eee1a9 100644 --- a/common/rfb/Configuration.cxx +++ b/common/rfb/Configuration.cxx @@ -418,6 +418,12 @@ StringParameter::~StringParameter() { strFree(value); } +void StringParameter::setDefaultStr(const char* v) { + def_value = v; + strFree(value); + value = strDup(v); +} + bool StringParameter::setParam(const char* v) { LOCK_CONFIG; if (immutable) return true; diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h index 3e21b184..276651d5 100644 --- a/common/rfb/Configuration.h +++ b/common/rfb/Configuration.h @@ -240,6 +240,7 @@ namespace rfb { virtual bool setParam(const char* value); virtual char* getDefaultStr() const; virtual char* getValueStr() const; + void setDefaultStr(const char* v); // getData() returns a copy of the data - it must be delete[]d by the // caller. |