diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-14 17:45:07 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-15 14:10:26 +0200 |
commit | 2694ec6605891271ed99f69a03b3929178655963 (patch) | |
tree | e34426d92ffced7db70f7a3e4b8ba95ffa67c1e6 /src/core/web_engine_settings.h | |
parent | 4fec7134b45c61422acb63043b70b3bb0456d690 (diff) |
Fix a crash in WebEngineSettings when opening a new window
A new window means that the QWebEnginePage gets its WebContentsAdapter
swapped and that the pointer in WebEngineSettings must be updated.
Do the WebContentsAdapter-to-WebEngineSettings binding in
WebContentsAdapter::initialize to cover both cases.
This also refactors the way that QWebEngineSettings is created by
removing the need to pass a QWebEngineSettingsPrivate instance to be
adopted, and also move the global settings construction logic in
the singleton accessor instead of relying on the fact that it uses
a different contructor.
Change-Id: I6f8a2ed1407a4b25f9898526db9432721c354ddf
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/core/web_engine_settings.h')
-rw-r--r-- | src/core/web_engine_settings.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index 5e19c242d..a1c41c187 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -99,7 +99,6 @@ public: }; WebEngineSettings(WebEngineSettingsDelegate*); - WebEngineSettings(WebEngineSettingsDelegate *,WebContentsAdapter *); virtual ~WebEngineSettings(); void overrideWebPreferences(WebPreferences *prefs); @@ -125,6 +124,7 @@ public: private: void doApply(); void applySettingsToWebPreferences(WebPreferences *); + void setWebContentsAdapter(WebContentsAdapter *adapter) { m_adapter = adapter; } WebContentsAdapter* m_adapter; WebEngineSettingsDelegate* m_delegate; @@ -136,6 +136,7 @@ private: QScopedPointer<BatchTimer> m_batchTimer; friend class BatchTimer; + friend class WebContentsAdapter; }; #endif // WEB_ENGINE_SETTINGS_H |