aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webengineprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/webengineprofile.cpp')
-rw-r--r--src/webengine/webengineprofile.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp
index 814d38c..89cc301 100644
--- a/src/webengine/webengineprofile.cpp
+++ b/src/webengine/webengineprofile.cpp
@@ -27,8 +27,6 @@ WebEngineProfile::WebEngineProfile(QObject *parent) :
QWebEngineProfile(parent)
{
// Off-the-record constructor
-
- m_profileDialog = new ProfileDialog(this);
}
WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent) :
@@ -37,8 +35,6 @@ WebEngineProfile::WebEngineProfile(const QString &storageName, QObject *parent)
setPersistentStoragePath(sSettings->value("browser.profile.path").toString() + storageName);
setCachePath(sSettings->value("browser.profile.path").toString() + storageName);
- m_profileDialog = new ProfileDialog(this);
-
QString profilePath = persistentStoragePath() + "/profile.ini";
qDebug("Reading profile from [%s]", qUtf8Printable(profilePath));
QSettings config(profilePath, QSettings::IniFormat);
@@ -110,10 +106,16 @@ WebEngineProfile::~WebEngineProfile()
if(!isOffTheRecord()) {
saveProfile();
}
+ if(m_profileDialog != nullptr) {
+ m_profileDialog->deleteLater();
+ }
}
ProfileDialog *WebEngineProfile::dialog()
{
+ if(m_profileDialog == nullptr) {
+ m_profileDialog = new ProfileDialog(this);
+ }
return m_profileDialog;
}