aboutsummaryrefslogtreecommitdiff
path: root/lib/web/webprofile.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/web/webprofile.h')
-rw-r--r--lib/web/webprofile.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/lib/web/webprofile.h b/lib/web/webprofile.h
index 260ff36..2282afe 100644
--- a/lib/web/webprofile.h
+++ b/lib/web/webprofile.h
@@ -16,24 +16,26 @@
#include <QVector>
#include <QNetworkCookie>
#include <QMap>
+#include <QWebEngineSettings>
class WebProfile : public QWebEngineProfile
{
Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString search READ search WRITE setSearch NOTIFY searchChanged)
Q_PROPERTY(QUrl homepage READ homepage WRITE setHomepage NOTIFY homepageChanged)
Q_PROPERTY(QUrl newtab READ newtab WRITE setNewtab NOTIFY newtabChanged)
// QWebEngineProfile should-be properties
- Q_PROPERTY(QString cachePath READ cachePath WRITE setCachePath NOTIFY cachePathChanged)
- Q_PROPERTY(QString persistentStoragePath READ persistentStoragePath WRITE setPersistentStoragePath NOTIFY persistentStoragePathChanged)
+ Q_PROPERTY(QString cachePath READ cachePath WRITE setCachePath NOTIFY propertyChanged)
+ Q_PROPERTY(QString persistentStoragePath READ persistentStoragePath WRITE setPersistentStoragePath NOTIFY propertyChanged)
- Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY httpAcceptLanguageChanged)
- Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY httpCacheMaximumSizeChanged)
- Q_PROPERTY(QString httpUserAgent READ httpUserAgent WRITE setHttpUserAgent NOTIFY httpUserAgentChanged)
+ Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY propertyChanged)
+ Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY propertyChanged)
+ Q_PROPERTY(QString httpUserAgent READ httpUserAgent WRITE setHttpUserAgent NOTIFY propertyChanged)
- Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY spellCheckEnabledChanged)
+ Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY propertyChanged)
public:
// off-the-record constructor
@@ -54,10 +56,8 @@ public:
return WebProfile::profile;
}
- QString name() const
- {
- return m_name;
- }
+ const QString name() const;
+ void setName(const QString &name);
const QVector<QNetworkCookie> cookies() const
{
@@ -86,18 +86,13 @@ public:
void setSpellCheckEnabled(bool enable);
signals:
+ void nameChanged(const QString &name);
void searchChanged(const QString &url);
void homepageChanged(const QUrl &url);
void newtabChanged(const QUrl &url);
- void cachePathChanged(const QString &path);
- void persistentStoragePathChanged(const QString &path);
-
- void httpAcceptLanguageChanged(const QString &httpAcceptLanguage);
- void httpCacheMaximumSizeChanged(int maxSize);
- void httpUserAgentChanged(const QString &userAgent);
-
- void spellCheckEnabledChanged(bool enable);
+ void propertyChanged(const QString &name, const QVariant &value);
+ void attributeChanged(const QWebEngineSettings::WebAttribute attribute, const bool value);
private:
static WebProfile *profile;
@@ -110,6 +105,4 @@ private:
QVector<QNetworkCookie> m_cookies;
};
-//WebProfile *saveProfile(WebProfile *profile, const QString &path);
-
#endif // SMOLBOTE_WEBENGINEPROFILE_H