From 1efd63efaf435db81cf5bfd0ca6b0534d8c1c36c Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 14 Jun 2018 18:09:01 +0200 Subject: ProfileEditor: add delete button --- lib/web/webprofile.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/web/webprofile.cpp') diff --git a/lib/web/webprofile.cpp b/lib/web/webprofile.cpp index 67671a0..dca639b 100644 --- a/lib/web/webprofile.cpp +++ b/lib/web/webprofile.cpp @@ -24,15 +24,15 @@ WebProfile* loadProfile(const QString &name, const QHash &defa if(name.isEmpty()) { // a default otr profile - profile = new WebProfile(QObject::tr("Off-the-record"), nullptr); + profile = new WebProfile(QObject::tr("Off-the-record"), path, nullptr); } else if(config.value("otr").toBool()) { // a named otr profile - profile = new WebProfile(config.value("name", name).toString(), nullptr); + profile = new WebProfile(config.value("name", name).toString(), path, nullptr); } else { // a named profile - profile = new WebProfile(name, config.value("name", name).toString(), nullptr); + profile = new WebProfile(name, config.value("name", name).toString(), path, nullptr); } Q_CHECK_PTR(profile); @@ -70,20 +70,22 @@ WebProfile* loadProfile(const QString &name, const QHash &defa return profile; } -WebProfile::WebProfile(const QString &name, QObject *parent) +WebProfile::WebProfile(const QString &name, const QString &configPath, QObject *parent) : QWebEngineProfile(parent) { m_name = name; + m_configPath = configPath; #ifdef QT_DEBUG qDebug("Creating otr profile %s", qUtf8Printable(m_name)); #endif } -WebProfile::WebProfile(const QString &storageName, const QString &name, QObject *parent) +WebProfile::WebProfile(const QString &storageName, const QString &name, const QString &configPath, QObject *parent) : QWebEngineProfile(storageName, parent) { m_name = name; + m_configPath = configPath; #ifdef QT_DEBUG qDebug("Creating profile %s", qUtf8Printable(m_name)); -- cgit v1.2.1