aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2005-01-03 14:47:42 +0000
committerPeter Åstrand <astrand@cendio.se>2005-01-03 14:47:42 +0000
commit073505919e2788515fd78e537dd567a45240137f (patch)
treedbc6ac267af3dde1b9c5480a807bb5d37a45581a
parent3e3c75ec5642579b1a7e3ebab36a7f3c3866467d (diff)
downloadtigervnc-073505919e2788515fd78e537dd567a45240137f.tar.gz
tigervnc-073505919e2788515fd78e537dd567a45240137f.zip
Bugfix for Configuration system: When using alias parameters, the immutable flag in the real parameter instance should be set.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@81 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--rfb/Configuration.cxx18
-rw-r--r--rfb/Configuration.h1
2 files changed, 14 insertions, 5 deletions
diff --git a/rfb/Configuration.cxx b/rfb/Configuration.cxx
index fc682103..f4b9f957 100644
--- a/rfb/Configuration.cxx
+++ b/rfb/Configuration.cxx
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2004 RealVNC Ltd. All Rights Reserved.
+ * Copyright (C) 2004 Peter Astrand, Cendio AB. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,8 +69,8 @@ bool Configuration::setParam(const char* name, int len,
{
bool b = current->setParam(val);
current->setHasBeenSet();
- if (b && immutable)
- current->setImmutable();
+ if (b && immutable)
+ current->setImmutable();
return b;
}
current = current->_next;
@@ -93,8 +94,8 @@ bool Configuration::setParam(const char* config, bool immutable) {
if (strcasecmp(current->getName(), config) == 0) {
bool b = current->setParam();
current->setHasBeenSet();
- if (b && immutable)
- current->setImmutable();
+ if (b && immutable)
+ current->setImmutable();
return b;
}
current = current->_next;
@@ -225,6 +226,13 @@ bool AliasParameter::isBool() const {
return param->isBool();
}
+void
+AliasParameter::setImmutable() {
+ vlog.debug("set immutable %s (Alias)", getName());
+ param->setImmutable();
+}
+
+
// -=- BoolParameter
BoolParameter::BoolParameter(const char* name_, const char* desc_, bool v)
@@ -389,7 +397,7 @@ void BinaryParameter::setParam(const void* v, int len) {
#ifdef WIN32
Lock l(configLock);
#endif
- if (immutable) return;
+ if (immutable) return;
vlog.debug("set %s(Binary)", getName());
delete [] value; value = 0;
if (len) {
diff --git a/rfb/Configuration.h b/rfb/Configuration.h
index 20aec992..d50c1cb1 100644
--- a/rfb/Configuration.h
+++ b/rfb/Configuration.h
@@ -97,6 +97,7 @@ namespace rfb {
virtual char* getDefaultStr() const;
virtual char* getValueStr() const;
virtual bool isBool() const;
+ virtual void setImmutable();
private:
VoidParameter* param;
};