aboutsummaryrefslogtreecommitdiff
path: root/src/webengine/webprofile.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 14:57:18 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 14:57:18 +0200
commitc0632b62cfb62794ae858f0da2bff5850dbac070 (patch)
tree1a11aaa978636999847d46c287fb5e26aa3f02b1 /src/webengine/webprofile.h
parentShow view profile instead of window profile in title (diff)
downloadsmolbote-c0632b62cfb62794ae858f0da2bff5850dbac070.tar.xz
Profile properties
Diffstat (limited to 'src/webengine/webprofile.h')
-rw-r--r--src/webengine/webprofile.h43
1 files changed, 34 insertions, 9 deletions
diff --git a/src/webengine/webprofile.h b/src/webengine/webprofile.h
index ddb642c..e11d7c5 100644
--- a/src/webengine/webprofile.h
+++ b/src/webengine/webprofile.h
@@ -17,8 +17,14 @@
class WebProfile : public QWebEngineProfile
{
Q_OBJECT
+
+ //Q_PROPERTY(QString cachePath READ cachePath WRITE setCachePath)
+ Q_PROPERTY(QString search READ search WRITE setSearch)
+ Q_PROPERTY(QUrl homepage READ homepage WRITE setHomepage)
+ Q_PROPERTY(QUrl newtab READ newtab WRITE setNewtab)
+
public:
- explicit WebProfile(QObject *parent = nullptr);
+ explicit WebProfile(const QHash<QString, QString> &defaults, QObject *parent = nullptr);
explicit WebProfile(const QString &name, QObject *parent = nullptr);
~WebProfile() override;
@@ -34,13 +40,34 @@ public:
return WebProfile::profile;
}
- QString name() const;
+ QString name() const
+ {
+ return m_name;
+ }
QString search() const
{
return m_search;
}
- QUrl homepage() const;
- QUrl newtab() const;
+ void setSearch(const QString &url)
+ {
+ m_search = url;
+ }
+ QUrl homepage() const
+ {
+ return m_homepage;
+ }
+ void setHomepage(const QUrl &url)
+ {
+ m_homepage = url;
+ }
+ QUrl newtab() const
+ {
+ return m_newtab;
+ }
+ void setNewtab(const QUrl &url)
+ {
+ m_newtab = url;
+ }
void addBookmark(const QString &title, const QString &url)
{
@@ -51,18 +78,16 @@ public:
signals:
void addBookmarkRequested(const QString &title, const QString &url);
-public slots:
- void loadProfile(QHash<QString, QString> conf);
- void saveProfile(const QString &path = QString());
-
private:
static WebProfile *profile;
- QString m_configPath;
QString m_name;
QString m_search = QString("about:blank");
QUrl m_homepage = QUrl("about:blank");
QUrl m_newtab = QUrl("about:blank");
};
+void loadProfile(WebProfile *profile, const QString &path);
+//WebProfile *saveProfile(const QString &path);
+
#endif // SMOLBOTE_WEBENGINEPROFILE_H