mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Explicitly use system proxy in QNetwork
This commit is contained in:
parent
9c897eb926
commit
47d2364a80
@ -16,9 +16,9 @@ from threading import Lock, RLock
|
|||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QT_VERSION, QApplication, QBuffer, QByteArray, QCoreApplication, QDateTime,
|
QT_VERSION, QApplication, QBuffer, QByteArray, QCoreApplication, QDateTime,
|
||||||
QDesktopServices, QDialog, QEvent, QFileDialog, QFileIconProvider, QFileInfo,
|
QDesktopServices, QDialog, QEvent, QFileDialog, QFileIconProvider, QFileInfo,
|
||||||
QFont, QFontDatabase, QFontInfo, QFontMetrics, QIcon, QLocale, QObject,
|
QFont, QFontDatabase, QFontInfo, QFontMetrics, QIcon, QLocale,
|
||||||
QSettings, QSocketNotifier, QStringListModel, Qt, QThread, QTimer, QTranslator,
|
QNetworkProxyFactory, QObject, QSettings, QSocketNotifier, QStringListModel, Qt,
|
||||||
QUrl, pyqtSignal
|
QThread, QTimer, QTranslator, QUrl, pyqtSignal
|
||||||
)
|
)
|
||||||
from PyQt5.QtWidgets import QStyle # Gives a nicer error message than import from Qt
|
from PyQt5.QtWidgets import QStyle # Gives a nicer error message than import from Qt
|
||||||
|
|
||||||
@ -38,9 +38,10 @@ from calibre.utils.config import Config, ConfigProxy, JSONConfig, dynamic
|
|||||||
from calibre.utils.date import UNDEFINED_DATE
|
from calibre.utils.date import UNDEFINED_DATE
|
||||||
from calibre.utils.file_type_icons import EXT_MAP
|
from calibre.utils.file_type_icons import EXT_MAP
|
||||||
from calibre.utils.localization import get_lang
|
from calibre.utils.localization import get_lang
|
||||||
from polyglot.builtins import (iteritems, itervalues, unicode_type,
|
|
||||||
string_or_bytes, range, map)
|
|
||||||
from polyglot import queue
|
from polyglot import queue
|
||||||
|
from polyglot.builtins import (
|
||||||
|
iteritems, itervalues, range, string_or_bytes, unicode_type, map
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
NO_URL_FORMATTING = QUrl.None_
|
NO_URL_FORMATTING = QUrl.None_
|
||||||
@ -817,6 +818,7 @@ class Application(QApplication):
|
|||||||
shutdown_signal_received = pyqtSignal()
|
shutdown_signal_received = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
|
def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
|
||||||
|
QNetworkProxyFactory.setUseSystemConfiguration(True)
|
||||||
if iswindows:
|
if iswindows:
|
||||||
self.windows_app_uid = None
|
self.windows_app_uid = None
|
||||||
if windows_app_uid:
|
if windows_app_uid:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user