diff options
author | Alex <b0ris@b0ris-satellite.localdomain> | 2011-11-02 00:44:21 +0200 |
---|---|---|
committer | Alex <b0ris@b0ris-satellite.localdomain> | 2011-11-02 00:44:21 +0200 |
commit | d4feb36aac09cb7d1d66cb069bb438daaea68705 (patch) | |
tree | e3222c2da2d438af7cc3695133fcb49cfca0a0d1 /client/Config.cpp | |
parent | 0b167475b3d838bc0a71d30e0356ccff2d819d8f (diff) |
Resource files w certs. Fix static proxy labels and order. Panel label alignment
Diffstat (limited to 'client/Config.cpp')
-rw-r--r-- | client/Config.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/client/Config.cpp b/client/Config.cpp index 7fef568..4fcaea9 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -17,13 +17,18 @@ Config *Config::CurrentConfig() return self; } -Config::Config(): configValid(0) +Config::Config(): configValid(0), StaticProxySpeedLow(50) { } void Config::AcquireConfig() { + /* reset existing values */ configValid = false; + genericProxy.clear(); + staticProxy.clear(); + + /* read new values */ if (ReadGenericProxy()) return ; if (ReadStaticProxy()) @@ -119,9 +124,21 @@ vector<ProxyEntryStatic> Config::GetStaticProxyGuiLine(int line) vector<ProxyEntryStatic> staticProxyLine; for (unsigned i = 0; i < staticProxy.size(); i++) { - if (staticProxy[i].position == line) + if (staticProxy[i].position != line) staticProxyLine.push_back(staticProxy[i]); } + + /* sort manually using bubble sort - not too efficient, + * but I suppose we're not going too sort millions of records */ + for (unsigned i = 0; i < staticProxyLine.size(); i++) + { + for (unsigned j = 1; j < staticProxyLine.size(); j++) + { + if (staticProxyLine[j].speed > staticProxyLine[j-1].speed) + swap(staticProxyLine[j], staticProxyLine[j-1]); + } + } + return staticProxyLine; } |