@@ -173,15 +173,17 @@ def removeDir(path):
173
173
# --- class QPNetworkAccessManager ----------------------------------------------------------------------- #
174
174
# --- It's a temporary workaround for broken proxy handling in Qt ------------------------- #
175
175
class QPNetworkAccessManager (QNetworkAccessManager ):
176
- def __init__ (self ,* args ):
176
+ def __init__ (self , repoUrl ):
177
177
QNetworkAccessManager .__init__ (self ,)
178
178
settings = QSettings ()
179
179
settings .beginGroup ("proxy" )
180
180
if settings .value ("/proxyEnabled" , False , type = bool ):
181
181
self .proxy = QNetworkProxy ()
182
182
proxyType = settings .value ( "/proxyType" , "0" , type = unicode )
183
- if len (args ) > 0 and settings .value ("/proxyExcludedUrls" ,"" , type = unicode ).find (args [0 ]) > - 1 :
184
- proxyType = "NoProxy"
183
+ if repoUrl :
184
+ for excludedUrl in settings .value ("/proxyExcludedUrls" ,"" , type = unicode ).split ("|" ):
185
+ if repoUrl .find ( excludedUrl ) > - 1 :
186
+ proxyType = "NoProxy"
185
187
if proxyType in ["1" ,"Socks5Proxy" ]: self .proxy .setType (QNetworkProxy .Socks5Proxy )
186
188
elif proxyType in ["2" ,"NoProxy" ]: self .proxy .setType (QNetworkProxy .NoProxy )
187
189
elif proxyType in ["3" ,"HttpProxy" ]: self .proxy .setType (QNetworkProxy .HttpProxy )
@@ -393,8 +395,7 @@ def load(self):
393
395
self .mRepositories [key ]["url" ] = settings .value (key + "/url" , "" , type = unicode )
394
396
self .mRepositories [key ]["enabled" ] = settings .value (key + "/enabled" , True , type = bool )
395
397
self .mRepositories [key ]["valid" ] = settings .value (key + "/valid" , True , type = bool )
396
- self .mRepositories [key ]["QPNAM" ] = QPNetworkAccessManager ()
397
-
398
+ self .mRepositories [key ]["QPNAM" ] = QPNetworkAccessManager ( self .mRepositories [key ]["url" ] )
398
399
self .mRepositories [key ]["Relay" ] = Relay (key )
399
400
self .mRepositories [key ]["xmlData" ] = None
400
401
self .mRepositories [key ]["state" ] = 0
0 commit comments