From 354b9d16959505ecc29cf6160d1929254b9b2433 Mon Sep 17 00:00:00 2001 From: nowrep Date: Sat, 18 Jan 2014 11:41:08 +0100 Subject: [PATCH] [Preferences] Lazy reload of MainApp preferences Re-setting user stylesheet with a lot of AdBlock hiding rules takes quite some time for QtWebKitSettings. --- src/lib/app/mainapplication.cpp | 3 ++- src/lib/app/mainapplication.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 1e1cd6ff5..0b54ba084 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -424,7 +424,8 @@ void MainApplication::loadSettings() void MainApplication::reloadSettings() { - loadSettings(); + QTimer::singleShot(0, this, SLOT(loadSettings())); + emit message(Qz::AM_ReloadSettings, true); } diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index 502611c1b..a2956442f 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -72,7 +72,6 @@ public: ~MainApplication(); void connectDatabase(); - void loadSettings(); void reloadSettings(); bool restoreStateSlot(QupZilla* window, RestoreData recoveryData); QupZilla* makeNewWindow(Qz::BrowserWindow type, const QUrl &startUrl = QUrl()); @@ -152,6 +151,7 @@ signals: void message(Qz::AppMessageType mes, bool state); private slots: + void loadSettings(); void postLaunch(); void setupJumpList(); void restoreCursor();