diff options
Diffstat (limited to 'client/Proxifier.cpp')
-rw-r--r-- | client/Proxifier.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/client/Proxifier.cpp b/client/Proxifier.cpp index 4485647..0d3005d 100644 --- a/client/Proxifier.cpp +++ b/client/Proxifier.cpp @@ -320,13 +320,15 @@ bool Proxifier::TurnProxyOn(Proxy& proxy) { // proxy is not enabled - remove it and add again RemoveProxyFromChain(proxyId, chainId); - AddProxyToChain(proxyId, chainId); + bool isHttp = (stricmp(proxy.type.c_str(), "http") == 0); + AddProxyToChain(proxyId, chainId, isHttp); } } else { // proxy not found in the target chain - add it - AddProxyToChain(proxyId, chainId); + bool isHttp = (stricmp(proxy.type.c_str(), "http") == 0); + AddProxyToChain(proxyId, chainId, isHttp); } } @@ -1013,7 +1015,16 @@ bool Proxifier::AddProxyToChain(int proxyId, int chainId, bool isHttp) idTxt.setNum(proxyId); QDomText nameTxt = configDom.createTextNode(idTxt); proxyElem.appendChild(nameTxt); - chainElem.appendChild(proxyElem); + // append Http proxies to then end, but prepend other ones + if (isHttp) + { + chainElem.appendChild(proxyElem); + } + else + { + // first child is 'Name' + chainElem.insertAfter(proxyElem, chainElem.firstChildElement()); + } break; } } |