Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore 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() | |||
127 | linkToRoot = cfg.readBoolEntry( key, true ); | 127 | linkToRoot = cfg.readBoolEntry( key, true ); |
128 | #endif | 128 | #endif |
129 | d.linkToRoot( linkToRoot ); | 129 | d.linkToRoot( linkToRoot ); |
130 | 130 | ||
131 | destList.push_back( d ); | 131 | destList.push_back( d ); |
132 | } | 132 | } |
133 | else if ( lineStr.startsWith( "option" ) ) | 133 | else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) ) |
134 | { | 134 | { |
135 | char type[20]; | 135 | char type[20]; |
136 | char val[100]; | 136 | char val[100]; |
137 | sscanf( lineStr, "%*[^ ] %s %s", type, val ); | 137 | sscanf( lineStr, "%*[^ ] %s %s", type, val ); |
138 | if ( stricmp( type, "http_proxy" ) == 0 ) | 138 | if ( stricmp( type, "http_proxy" ) == 0 ) |
139 | { | ||
139 | httpProxy = val; | 140 | httpProxy = val; |
141 | if ( lineStr.startsWith( "#" ) ) | ||
142 | httpProxyEnabled = false; | ||
143 | else | ||
144 | httpProxyEnabled = true; | ||
145 | } | ||
140 | if ( stricmp( type, "ftp_proxy" ) == 0 ) | 146 | if ( stricmp( type, "ftp_proxy" ) == 0 ) |
147 | { | ||
141 | ftpProxy = val; | 148 | ftpProxy = val; |
149 | if ( lineStr.startsWith( "#" ) ) | ||
150 | ftpProxyEnabled = false; | ||
151 | else | ||
152 | ftpProxyEnabled = true; | ||
153 | } | ||
142 | if ( stricmp( type, "proxy_username" ) == 0 ) | 154 | if ( stricmp( type, "proxy_username" ) == 0 ) |
143 | proxyUsername = val; | 155 | proxyUsername = val; |
144 | if ( stricmp( type, "proxy_password" ) == 0 ) | 156 | if ( stricmp( type, "proxy_password" ) == 0 ) |
145 | proxyPassword = val; | 157 | proxyPassword = val; |
146 | } | 158 | } |
147 | } | 159 | } |
@@ -215,24 +227,32 @@ void DataManager :: writeOutIpkgConf() | |||
215 | while ( it2 != destList.end() ) | 227 | while ( it2 != destList.end() ) |
216 | { | 228 | { |
217 | out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl; | 229 | out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl; |
218 | it2++; | 230 | it2++; |
219 | } | 231 | } |
220 | 232 | ||
233 | out << endl; | ||
221 | out << "# Proxy Support" << endl; | 234 | out << "# Proxy Support" << endl; |
222 | out << "#" << endl; | ||
223 | 235 | ||
224 | if ( httpProxy == "" ) | 236 | if ( !httpProxyEnabled && httpProxy == "" ) |
225 | out << "#option http_proxy http://proxy.tld:3128" << endl; | 237 | out << "#option http_proxy http://proxy.tld:3128" << endl; |
226 | else | 238 | else |
239 | { | ||
240 | if ( !httpProxyEnabled ) | ||
241 | out << "#"; | ||
227 | out << "option http_proxy " << httpProxy << endl; | 242 | out << "option http_proxy " << httpProxy << endl; |
243 | } | ||
228 | 244 | ||
229 | if ( ftpProxy == "" ) | 245 | if ( !ftpProxyEnabled && ftpProxy == "" ) |
230 | out << "#option ftp_proxy http://proxy.tld:3128" << endl; | 246 | out << "#option ftp_proxy http://proxy.tld:3128" << endl; |
231 | else | 247 | else |
248 | { | ||
249 | if ( !ftpProxyEnabled ) | ||
250 | out << "#"; | ||
232 | out << "option ftp_proxy " << ftpProxy << endl; | 251 | out << "option ftp_proxy " << ftpProxy << endl; |
252 | } | ||
233 | if ( proxyUsername == "" ) | 253 | if ( proxyUsername == "" ) |
234 | out << "#option proxy_username <username>" << endl; | 254 | out << "#option proxy_username <username>" << endl; |
235 | else | 255 | else |
236 | out << "option proxy_username " << proxyUsername << endl; | 256 | out << "option proxy_username " << proxyUsername << endl; |
237 | if ( proxyPassword == "" ) | 257 | if ( proxyPassword == "" ) |
238 | out << "#option proxy_password <password>" << endl << endl; | 258 | out << "#option proxy_password <password>" << endl << endl; |