author | andyq <andyq> | 2002-12-12 00:18:40 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-12-12 00:18:40 (UTC) |
commit | 1d044ba4d276240b60bc98d18365a80183960751 (patch) (side-by-side diff) | |
tree | 98f69f03bb7ff4a904c02322be6480c54b6a7e08 /noncore/settings/aqpkg/datamgr.cpp | |
parent | fe063bdf069cd33def6347777624798e4f3a7059 (diff) | |
download | opie-1d044ba4d276240b60bc98d18365a80183960751.zip opie-1d044ba4d276240b60bc98d18365a80183960751.tar.gz opie-1d044ba4d276240b60bc98d18365a80183960751.tar.bz2 |
Added proxy support
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index 96c28c0..3933a22 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -127,21 +127,33 @@ void DataManager :: loadServers() linkToRoot = cfg.readBoolEntry( key, true ); #endif d.linkToRoot( linkToRoot ); destList.push_back( d ); } - else if ( lineStr.startsWith( "option" ) ) + else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) { char type[20]; char val[100]; sscanf( lineStr, "%*[^ ] %s %s", type, val ); if ( stricmp( type, "http_proxy" ) == 0 ) + { httpProxy = val; + if ( lineStr.startsWith( "#" ) ) + httpProxyEnabled = false; + else + httpProxyEnabled = true; + } if ( stricmp( type, "ftp_proxy" ) == 0 ) + { ftpProxy = val; + if ( lineStr.startsWith( "#" ) ) + ftpProxyEnabled = false; + else + ftpProxyEnabled = true; + } if ( stricmp( type, "proxy_username" ) == 0 ) proxyUsername = val; if ( stricmp( type, "proxy_password" ) == 0 ) proxyPassword = val; } } @@ -215,24 +227,32 @@ void DataManager :: writeOutIpkgConf() while ( it2 != destList.end() ) { out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl; it2++; } + out << endl; out << "# Proxy Support" << endl; - out << "#" << endl; - if ( httpProxy == "" ) + if ( !httpProxyEnabled && httpProxy == "" ) out << "#option http_proxy http://proxy.tld:3128" << endl; else + { + if ( !httpProxyEnabled ) + out << "#"; out << "option http_proxy " << httpProxy << endl; + } - if ( ftpProxy == "" ) + if ( !ftpProxyEnabled && ftpProxy == "" ) out << "#option ftp_proxy http://proxy.tld:3128" << endl; else + { + if ( !ftpProxyEnabled ) + out << "#"; out << "option ftp_proxy " << ftpProxy << endl; + } if ( proxyUsername == "" ) out << "#option proxy_username <username>" << endl; else out << "option proxy_username " << proxyUsername << endl; if ( proxyPassword == "" ) out << "#option proxy_password <password>" << endl << endl; |