mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Move qt conf env var setting earlier into startup
Maybe that will convince webengine to use it
This commit is contained in:
parent
f46cb54a31
commit
ead225938a
@ -411,6 +411,9 @@ if getattr(sys, 'frozen', False):
|
||||
is_running_from_develop = running_in_develop_mode()
|
||||
|
||||
in_develop_mode = os.getenv('CALIBRE_ENABLE_DEVELOP_MODE') == '1'
|
||||
if iswindows:
|
||||
# Needed to get Qt to use the correct cache dir, relies on a patched Qt
|
||||
os.environ['CALIBRE_QT_CACHE_LOCATION'] = cache_dir()
|
||||
|
||||
|
||||
def get_version():
|
||||
|
@ -23,9 +23,8 @@ from threading import Lock, RLock
|
||||
import calibre.gui2.pyqt6_compat as pqc
|
||||
from calibre import as_unicode, prints
|
||||
from calibre.constants import (
|
||||
DEBUG, __appname__ as APP_UID, __version__, cache_dir, config_dir,
|
||||
is_running_from_develop, isbsd, isfrozen, islinux, ismacos, iswindows, isxp,
|
||||
plugins_loc
|
||||
DEBUG, __appname__ as APP_UID, __version__, config_dir, is_running_from_develop,
|
||||
isbsd, isfrozen, islinux, ismacos, iswindows, isxp, plugins_loc
|
||||
)
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
from calibre.gui2.linux_file_dialogs import (
|
||||
@ -1052,8 +1051,6 @@ class Application(QApplication):
|
||||
if gprefs['color_palette'] != 'system':
|
||||
set_appearance(gprefs['color_palette'])
|
||||
self.ignore_palette_changes = False
|
||||
if iswindows:
|
||||
os.environ['CALIBRE_QT_CACHE_LOCATION'] = cache_dir()
|
||||
QNetworkProxyFactory.setUseSystemConfiguration(True)
|
||||
# Allow import of webengine after construction of QApplication on new
|
||||
# enough PyQt
|
||||
|
@ -7,7 +7,6 @@ import sys
|
||||
import time
|
||||
|
||||
from qt.core import QIcon
|
||||
from qt.webengine import QWebEngineUrlScheme
|
||||
|
||||
from calibre.constants import EDITOR_APP_UID, FAKE_PROTOCOL, islinux
|
||||
from calibre.ebooks.oeb.polish.check.css import shutdown as shutdown_css_check_pool
|
||||
@ -51,6 +50,7 @@ def gui_main(path=None, notify=None):
|
||||
|
||||
|
||||
def _run(args, notify=None):
|
||||
from qt.webengine import QWebEngineUrlScheme
|
||||
# Ensure we can continue to function if GUI is closed
|
||||
os.environ.pop('CALIBRE_WORKER_TEMP_DIR', None)
|
||||
reset_base_dir()
|
||||
|
@ -7,7 +7,6 @@ import os
|
||||
import sys
|
||||
from contextlib import closing
|
||||
from qt.core import QIcon, QObject, Qt, QTimer, pyqtSignal
|
||||
from qt.webengine import QWebEngineUrlScheme
|
||||
|
||||
from calibre.constants import FAKE_PROTOCOL, VIEWER_APP_UID, islinux
|
||||
from calibre.gui2 import Application, error_dialog, setup_gui_option_parser
|
||||
@ -168,6 +167,7 @@ def run_gui(app, opts, args, internal_book_data, listener=None):
|
||||
|
||||
|
||||
def main(args=sys.argv):
|
||||
from qt.webengine import QWebEngineUrlScheme
|
||||
# Ensure viewer can continue to function if GUI is closed
|
||||
os.environ.pop('CALIBRE_WORKER_TEMP_DIR', None)
|
||||
reset_base_dir()
|
||||
|
Loading…
x
Reference in New Issue
Block a user