Load adblock settings in background

Review Request #111712 - Created July 26, 2013 and submitted

Information
Paul Rohrbach
rekonq
Reviewers
rekonq
Load the adblock settings in background.

If you open rekonq and start typing immediately, there is a small lag (about half a second). This is caused by the AdBlockManager::loadSettings function reading the adblock rules. It is called with a one second delay to make the startup faster. With this patch, the function is called in a separate thread using QtConcurrent::run to eliminate the lag. 

To make this safe, the adblocker is enabled after the settings are loaded, which means, that the first site loaded could be partially with ads. But this is no change in behavior, as the adblocker in current master is disabled for a whole second. 

The only times this blocks now is in situations, where it is necessary that the settings are loaded (showSettings and addCustomRule), but I guess that no normal user will use those in under a second after startup :).
- compiles, loads settings
- fixes the lag
Andrea Diamantini
Commit Hook
Paul Rohrbach
Review request changed

Status: Closed (submitted)

Loading...