From 103a6a013b6e6df1d1dbbcd073fc9a931fa4cf0a Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 1 Nov 2011 02:49:07 +0200 Subject: Fix generic proxy parsing bug. New generic proxy button layouting. Static proxy button functionality --- client/Config.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'client/Config.cpp') diff --git a/client/Config.cpp b/client/Config.cpp index 614d95f..7fef568 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -114,6 +114,28 @@ vector Config::GetProxies(string &country, string &state, string &city) return proxies; } +vector Config::GetStaticProxyGuiLine(int line) +{ + vector staticProxyLine; + for (unsigned i = 0; i < staticProxy.size(); i++) + { + if (staticProxy[i].position == line) + staticProxyLine.push_back(staticProxy[i]); + } + return staticProxyLine; +} + +unsigned Config::GetStaticProxyGuiLines() +{ + int maxLine = 0; + for (unsigned i = 0; i < staticProxy.size(); i++) + { + if (staticProxy[i].position > maxLine) + maxLine = staticProxy[i].position; + } + return maxLine; +} + int Config::ReadGenericProxy() { Logger::Info("Parsing generic proxy list\n"); @@ -130,6 +152,7 @@ int Config::ReadGenericProxy() while (!proxyFile.eof()) { proxyFile.getline(str, str_size, ';'); + proxyFile.ignore(2, '\n'); if (proxyFile.eof()) break; string entry = str; @@ -157,6 +180,7 @@ int Config::ReadStaticProxy() while (!proxyFile.eof()) { proxyFile.getline(str, str_size, ';'); + proxyFile.ignore(2, '\n'); if (proxyFile.eof()) break; string entry = str; -- cgit v1.2.3