diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-14 18:09:01 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-14 18:09:01 +0200 |
commit | 1efd63efaf435db81cf5bfd0ca6b0534d8c1c36c (patch) | |
tree | ee62ae5a32ef13983f61379e3d25b14f0e07179c /lib | |
parent | Add poi.desktop (diff) | |
download | smolbote-1efd63efaf435db81cf5bfd0ca6b0534d8c1c36c.tar.xz |
ProfileEditor: add delete button
Diffstat (limited to 'lib')
-rw-r--r-- | lib/web/webprofile.cpp | 12 | ||||
-rw-r--r-- | lib/web/webprofile.h | 9 |
2 files changed, 14 insertions, 7 deletions
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<QString, QString> &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<QString, QString> &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)); diff --git a/lib/web/webprofile.h b/lib/web/webprofile.h index a421359..7a747a3 100644 --- a/lib/web/webprofile.h +++ b/lib/web/webprofile.h @@ -34,9 +34,9 @@ class WebProfile : public QWebEngineProfile public: // off-the-record constructor - explicit WebProfile(const QString &name, QObject *parent = nullptr); + explicit WebProfile(const QString &name, const QString &configPath, QObject *parent = nullptr); // default constructor - explicit WebProfile(const QString &storageName, const QString &name, QObject *parent = nullptr); + explicit WebProfile(const QString &storageName, const QString &name, const QString &configPath, QObject *parent = nullptr); ~WebProfile() = default; @@ -55,6 +55,10 @@ public: { return m_name; } + QString configurationPath() const + { + return m_configPath; + } // search url QString search() const; @@ -102,6 +106,7 @@ signals: private: static WebProfile *profile; + QString m_configPath; QString m_name; QString m_search = QString("about:blank"); QUrl m_homepage = QUrl("about:blank"); |