Skip to content

Commit

Permalink
Merge pull request #32046 from borysiasty/fix_pre_qt56
Browse files Browse the repository at this point in the history
[bugfix] Fix plugin manager not working with QT < 5.6
  • Loading branch information
borysiasty committed Sep 28, 2019
2 parents 10bfd47 + 81bcb59 commit 8c0e0a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/pyplugin_installer/installer_data.py
Expand Up @@ -23,7 +23,7 @@
***************************************************************************/
"""

from qgis.PyQt.QtCore import (pyqtSignal, QObject, QCoreApplication, QFile,
from qgis.PyQt.QtCore import (pyqtSignal, qVersion, QObject, QCoreApplication, QFile,
QDir, QDirIterator, QDate, QUrl, QFileInfo,
QLocale, QByteArray)
from qgis.PyQt.QtXml import QDomDocument
Expand Down Expand Up @@ -322,7 +322,10 @@ def requestFetching(self, key, url=None, redirectionCounter=0):
# url.addQueryItem('qgis', '.'.join([str(int(s)) for s in [v[0], v[1:3]]]) ) # don't include the bugfix version!

self.mRepositories[key]["QRequest"] = QNetworkRequest(url)
self.mRepositories[key]["QRequest"].setAttribute(QNetworkRequest.FollowRedirectsAttribute, True)
qtVersion = [int(v) for v in qVersion().split('.')]
if qtVersion >= [5, 6, 0]:
# QNetworkRequest.FollowRedirectsAttribute has been introduced in QT 5.6
self.mRepositories[key]["QRequest"].setAttribute(QNetworkRequest.FollowRedirectsAttribute, True)
authcfg = self.mRepositories[key]["authcfg"]
if authcfg and isinstance(authcfg, str):
if not QgsApplication.authManager().updateNetworkRequest(
Expand Down

0 comments on commit 8c0e0a7

Please sign in to comment.