Skip to content
Permalink
Browse files

[bugfix] Use QgsApplication.authManager()

instead of the old singleton
  • Loading branch information
elpaso committed Nov 7, 2017
1 parent 7c9cd49 commit bb36fa7f486ce75bd95dba8c517db645511d539c
@@ -41,7 +41,7 @@
except ImportError:
from imp import reload
import qgis.utils
from qgis.core import Qgis, QgsNetworkAccessManager, QgsAuthManager
from qgis.core import Qgis, QgsNetworkAccessManager, QgsApplication
from qgis.gui import QgsMessageBar
from qgis.utils import iface, plugin_paths
from .version_compare import compareVersions, normalizeVersion, isCompatible
@@ -333,7 +333,7 @@ def requestFetching(self, key):
self.mRepositories[key]["QRequest"] = QNetworkRequest(url)
authcfg = self.mRepositories[key]["authcfg"]
if authcfg and isinstance(authcfg, str):
if not QgsAuthManager.instance().updateNetworkRequest(
if not QgsApplication.authManager().updateNetworkRequest(
self.mRepositories[key]["QRequest"], authcfg.strip()):
msg = QCoreApplication.translate(
"QgsPluginInstaller",
@@ -30,7 +30,7 @@
from qgis.PyQt.QtNetwork import QNetworkRequest, QNetworkReply

import qgis
from qgis.core import QgsNetworkAccessManager, QgsAuthManager
from qgis.core import QgsNetworkAccessManager, QgsApplication

from .ui_qgsplugininstallerinstallingbase import Ui_QgsPluginInstallerInstallingDialogBase
from .installer_data import removeDir, repositories
@@ -60,7 +60,7 @@ def __init__(self, parent, plugin):
self.request = QNetworkRequest(url)
authcfg = repositories.all()[plugin["zip_repository"]]["authcfg"]
if authcfg and isinstance(authcfg, str):
if not QgsAuthManager.instance().updateNetworkRequest(
if not QgsApplication.authManager().updateNetworkRequest(
self.request, authcfg.strip()):
self.mResult = self.tr(
"Update of network request with authentication "

0 comments on commit bb36fa7

Please sign in to comment.
You can’t perform that action at this time.