From d4feb36aac09cb7d1d66cb069bb438daaea68705 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 2 Nov 2011 00:44:21 +0200 Subject: Resource files w certs. Fix static proxy labels and order. Panel label alignment --- client/Config.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'client/Config.cpp') 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 Config::GetStaticProxyGuiLine(int line) vector 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; } -- cgit v1.2.3