@@ -420,6 +420,30 @@ int main(int argc, char **argv)
420
420
folder.chop (1 );
421
421
}
422
422
423
+ if (!options.proxy .isNull ()) {
424
+ QString host;
425
+ int port = 0 ;
426
+ bool ok;
427
+
428
+ QStringList pList = options.proxy .split (' :' );
429
+ if (pList.count () == 3 ) {
430
+ // http: //192.168.178.23 : 8080
431
+ // 0 1 2
432
+ host = pList.at (1 );
433
+ if (host.startsWith (" //" ))
434
+ host.remove (0 , 2 );
435
+
436
+ port = pList.at (2 ).toInt (&ok);
437
+
438
+ QNetworkProxyFactory::setUseSystemConfiguration (false );
439
+ QNetworkProxy::setApplicationProxy (QNetworkProxy (QNetworkProxy::HttpProxy, host, port));
440
+ } else {
441
+ qFatal (" Could not read httpproxy. The proxy should have the format \" http://hostname:port\" ." );
442
+ }
443
+ } else {
444
+ clientProxy.setupQtProxyFromConfig ();
445
+ }
446
+
423
447
SimpleSslErrorHandler *sslErrorHandler = new SimpleSslErrorHandler;
424
448
425
449
HttpCredentialsText *cred = new HttpCredentialsText (user, password);
@@ -457,31 +481,8 @@ int main(int argc, char **argv)
457
481
int restartCount = 0 ;
458
482
restart_sync:
459
483
460
-
461
484
opts = &options;
462
485
463
- if (!options.proxy .isNull ()) {
464
- QString host;
465
- int port = 0 ;
466
- bool ok;
467
-
468
- QStringList pList = options.proxy .split (' :' );
469
- if (pList.count () == 3 ) {
470
- // http: //192.168.178.23 : 8080
471
- // 0 1 2
472
- host = pList.at (1 );
473
- if (host.startsWith (" //" ))
474
- host.remove (0 , 2 );
475
-
476
- port = pList.at (2 ).toInt (&ok);
477
-
478
- QNetworkProxyFactory::setUseSystemConfiguration (false );
479
- QNetworkProxy::setApplicationProxy (QNetworkProxy (QNetworkProxy::HttpProxy, host, port));
480
- }
481
- } else {
482
- clientProxy.setupQtProxyFromConfig ();
483
- }
484
-
485
486
QStringList selectiveSyncList;
486
487
if (!options.unsyncedfolders .isEmpty ()) {
487
488
QFile f (options.unsyncedfolders );
0 commit comments