Remove parameter "hasBeenSet" logic
It doesn't really make sense anymore given that settings might come
from the GUI or configuration and not only the command line.
diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx
index d700522..8e1ea6e 100644
--- a/common/rfb/Configuration.cxx
+++ b/common/rfb/Configuration.cxx
@@ -88,7 +88,6 @@
strncasecmp(current->getName(), name, len) == 0)
{
bool b = current->setParam(val);
- current->setHasBeenSet();
if (b && immutable)
current->setImmutable();
return b;
@@ -113,7 +112,6 @@
while (current) {
if (strcasecmp(current->getName(), config) == 0) {
bool b = current->setParam();
- current->setHasBeenSet();
if (b && immutable)
current->setImmutable();
return b;
@@ -182,7 +180,7 @@
VoidParameter::VoidParameter(const char* name_, const char* desc_,
ConfigurationObject co)
- : immutable(false), _hasBeenSet(false), name(name_), description(desc_)
+ : immutable(false), name(name_), description(desc_)
{
Configuration *conf = NULL;
@@ -226,16 +224,6 @@
immutable = true;
}
-void
-VoidParameter::setHasBeenSet() {
- _hasBeenSet = true;
-}
-
-bool
-VoidParameter::hasBeenSet() {
- return _hasBeenSet;
-}
-
// -=- AliasParameter
AliasParameter::AliasParameter(const char* name_, const char* desc_,
diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h
index 4feeb78..da93fdd 100644
--- a/common/rfb/Configuration.h
+++ b/common/rfb/Configuration.h
@@ -165,8 +165,6 @@
virtual bool isBool() const;
virtual void setImmutable();
- virtual void setHasBeenSet();
- bool hasBeenSet();
protected:
friend class Configuration;
@@ -174,7 +172,6 @@
VoidParameter* _next;
bool immutable;
- bool _hasBeenSet;
const char* name;
const char* description;
};
diff --git a/tests/encperf.cxx b/tests/encperf.cxx
index 9b632e7..d93c771 100644
--- a/tests/encperf.cxx
+++ b/tests/encperf.cxx
@@ -427,12 +427,12 @@
usage(argv[0]);
}
- if (!format.hasBeenSet()) {
+ if (strcmp(format, "") == 0) {
fprintf(stderr, "Pixel format not specified!\n\n");
usage(argv[0]);
}
- if (!width.hasBeenSet() || !height.hasBeenSet()) {
+ if (width == 0 || height == 0) {
fprintf(stderr, "Frame buffer size not specified!\n\n");
usage(argv[0]);
}
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
index eb62edd..bba502b 100644
--- a/vncviewer/DesktopWindow.cxx
+++ b/vncviewer/DesktopWindow.cxx
@@ -85,7 +85,7 @@
// coordinates relative to the right edge / bottom edge) at this
// time.
int geom_x = 0, geom_y = 0;
- if (geometry.hasBeenSet()) {
+ if (strcmp(geometry, "") != 0) {
int matched;
matched = sscanf(geometry.getValueStr(), "+%d+%d", &geom_x, &geom_y);
if (matched == 2) {
@@ -606,12 +606,12 @@
void DesktopWindow::handleDesktopSize()
{
- if (desktopSize.hasBeenSet()) {
+ if (strcmp(desktopSize, "") != 0) {
int width, height;
// An explicit size has been requested
- if (sscanf(desktopSize.getValueStr(), "%dx%d", &width, &height) != 2)
+ if (sscanf(desktopSize, "%dx%d", &width, &height) != 2)
return;
remoteResize(width, height);
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx
index 09c8b2f..4b989bb 100644
--- a/vncviewer/vncviewer.cxx
+++ b/vncviewer/vncviewer.cxx
@@ -496,27 +496,6 @@
vncServerName[VNCSERVERNAMELEN - 1] = '\0';
}
- if (!::autoSelect.hasBeenSet()) {
- // Default to AutoSelect=0 if -PreferredEncoding or -FullColor is used
- if (::preferredEncoding.hasBeenSet() || ::fullColour.hasBeenSet() ||
- ::fullColourAlias.hasBeenSet()) {
- ::autoSelect.setParam(false);
- }
- }
- if (!::fullColour.hasBeenSet() && !::fullColourAlias.hasBeenSet()) {
- // Default to FullColor=0 if AutoSelect=0 && LowColorLevel is set
- if (!::autoSelect && (::lowColourLevel.hasBeenSet() ||
- ::lowColourLevelAlias.hasBeenSet())) {
- ::fullColour.setParam(false);
- }
- }
- if (!::customCompressLevel.hasBeenSet()) {
- // Default to CustomCompressLevel=1 if CompressLevel is used.
- if(::compressLevel.hasBeenSet()) {
- ::customCompressLevel.setParam(true);
- }
- }
-
mkvnchomedir();
CSecurity::upg = &dlg;