summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebengineprofile.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-04-23 12:34:58 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-05-28 14:36:54 +0000
commit6e28e764d7c425f942820f0881231eb83e553e6e (patch)
tree8ebcdb4c081cc92ec8be5a23d3473b74c53bba10 /src/webenginewidgets/api/qwebengineprofile.cpp
parentaf313cb881610fedb04c9d486597462e6b3c8e12 (diff)
Unify and simplify profile constructors
Use one constructor for private profile creation. Change-Id: I57a227b6344b6e308cfd4931986fa1dede75cfce Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/webenginewidgets/api/qwebengineprofile.cpp')
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 96cc2bb94..96e47a75d 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -147,25 +147,11 @@ using QtWebEngineCore::BrowserContextAdapter;
\sa QWebEngineDownloadItem, QWebEnginePage::download()
*/
-// Fixme: fix storage name setters and unify constructors here and in BrowserContextAdapter
-QWebEngineProfilePrivate::QWebEngineProfilePrivate(const QString &storageName)
- : m_settings(new QWebEngineSettings())
- , m_browserContextAdapter(storageName.isEmpty()?
- new QtWebEngineCore::BrowserContextAdapter(true):
- new QtWebEngineCore::BrowserContextAdapter(storageName))
- , m_scriptCollection(new QWebEngineScriptCollection(
- new QWebEngineScriptCollectionPrivate(m_browserContextAdapter->userResourceController())))
-{
- m_browserContextAdapter->addClient(this);
- m_settings->d_ptr->initDefaults();
-}
-
-// Fixme: fix storage name setters and unify constructors here and in BrowserContextAdapter
QWebEngineProfilePrivate::QWebEngineProfilePrivate(BrowserContextAdapter* browserContextAdapter)
: m_settings(new QWebEngineSettings())
, m_browserContextAdapter(browserContextAdapter)
, m_scriptCollection(new QWebEngineScriptCollection(
- new QWebEngineScriptCollectionPrivate(m_browserContextAdapter->userResourceController())))
+ new QWebEngineScriptCollectionPrivate(browserContextAdapter->userResourceController())))
{
m_browserContextAdapter->addClient(this);
m_settings->d_ptr->initDefaults();
@@ -267,7 +253,7 @@ void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
*/
QWebEngineProfile::QWebEngineProfile(QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate())
+ , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::BrowserContextAdapter()))
{
d_ptr->q_ptr = this;
}
@@ -284,7 +270,7 @@ QWebEngineProfile::QWebEngineProfile(QObject *parent)
*/
QWebEngineProfile::QWebEngineProfile(const QString &storageName, QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineProfilePrivate(storageName))
+ , d_ptr(new QWebEngineProfilePrivate(new QtWebEngineCore::BrowserContextAdapter(storageName)))
{
d_ptr->q_ptr = this;
}