aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-02-15 14:53:56 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-02-29 15:41:55 +0200
commit26e2926d5424f0c248892b4755c699541d46e856 (patch)
tree16ed0e75a31c4779d4d140b07262e89bca6971a0 /src
parentAdded example firefox/palemoon bookmarks to test (diff)
downloadsmolbote-26e2926d5424f0c248892b4755c699541d46e856.tar.xz
Remove ProfileInterface
Plugins should define their own specific interfaces rather than subclassing from ProfileInterface: - add Filter for QWebEngineUrlRequestInterceptor filters - add FilterPlugin for Filter loading Remove deprecated Browser::profileList()
Diffstat (limited to 'src')
-rw-r--r--src/browser.cpp9
-rw-r--r--src/browser.h5
-rw-r--r--src/meson.build2
-rw-r--r--src/webengine/webprofile.cpp4
-rw-r--r--src/webengine/webprofile.h31
5 files changed, 34 insertions, 17 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 3b47048..02d5bc9 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -89,15 +89,6 @@ void Browser::about()
dlg->exec();
}
-const QList<QPair<QString, Profile *>> Browser::profileList() const
-{
- QList<QPair<QString, Profile *>> profiles;
- for(const QString &id : m_profileManager->idList()) {
- profiles.append(qMakePair(id, m_profileManager->profile(id)));
- }
- return profiles;
-}
-
void Browser::loadProfiles(const QStringList &profilePaths)
{
Configuration conf;
diff --git a/src/browser.h b/src/browser.h
index ec6bb57..646d57e 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -23,9 +23,9 @@ class Configuration;
class BookmarksWidget;
class DownloadsWidget;
class MainWindow;
-class Profile;
+class WebProfile;
class WebProfileManager;
-class Browser : public SingleApplication
+class Browser final : public SingleApplication
{
Q_OBJECT
@@ -38,7 +38,6 @@ public slots:
public:
// interface
- [[deprecated]] const QList<QPair<QString, Profile *>> profileList() const;
void loadProfiles(const QStringList &profilePaths);
void loadPlugins(
const QStringList &paths,
diff --git a/src/meson.build b/src/meson.build
index 12c41c8..edc9db4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -57,7 +57,7 @@ poi_sourceset.add(files(
'wallet/wallet.cpp', 'wallet/wallet.h'
),
- interfaces_moc, version_h, poi_settings_h
+ version_h, poi_settings_h
)
poi_sourceset.add(when: [dep_breakpad, dep_threads],
diff --git a/src/webengine/webprofile.cpp b/src/webengine/webprofile.cpp
index 2cea409..5224189 100644
--- a/src/webengine/webprofile.cpp
+++ b/src/webengine/webprofile.cpp
@@ -26,7 +26,7 @@ WebProfile *WebProfile::defaultProfile()
}
WebProfile::WebProfile(const QString &name, QObject *parent)
- : Profile(parent)
+ : QWebEngineProfile(parent)
{
m_name = name;
@@ -39,7 +39,7 @@ WebProfile::WebProfile(const QString &name, QObject *parent)
}
WebProfile::WebProfile(const QString &storageName, const QString &name, QObject *parent)
- : Profile(storageName, parent)
+ : QWebEngineProfile(storageName, parent)
{
m_name = name;
diff --git a/src/webengine/webprofile.h b/src/webengine/webprofile.h
index 1ec2b88..66154af 100644
--- a/src/webengine/webprofile.h
+++ b/src/webengine/webprofile.h
@@ -17,15 +17,31 @@
#include <QVector>
#include <QWebEngineProfile>
#include <QWebEngineSettings>
-#include <profileinterface.h>
class WebProfileManager;
-class WebProfile : public Profile
+class WebProfile : public QWebEngineProfile
{
friend class WebProfileManager;
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 propertyChanged)
+ Q_PROPERTY(QString persistentStoragePath READ persistentStoragePath WRITE setPersistentStoragePath NOTIFY propertyChanged)
+ Q_PROPERTY(int persistentCookiesPolicy READ persistentCookiesPolicy WRITE setPersistentCookiesPolicy NOTIFY propertyChanged)
+
+ Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY propertyChanged)
+ Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY propertyChanged)
+ Q_PROPERTY(int httpCacheType READ httpCacheType WRITE setHttpCacheType NOTIFY propertyChanged)
+ Q_PROPERTY(QString httpUserAgent READ httpUserAgent WRITE setHttpUserAgent NOTIFY propertyChanged)
+
+ Q_PROPERTY(bool spellCheckEnabled READ isSpellCheckEnabled WRITE setSpellCheckEnabled NOTIFY propertyChanged)
+
public:
static WebProfile *defaultProfile();
static void setDefaultProfile(WebProfile *profile);
@@ -69,6 +85,17 @@ 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 propertyChanged(const QString &name, const QVariant &value);
+ void attributeChanged(const QWebEngineSettings::WebAttribute attribute, const bool value);
+ void headerChanged(const QString &name, const QString &value);
+ void headerRemoved(const QString &name);
+
protected:
// off-the-record constructor
explicit WebProfile(const QString &name, QObject *parent = nullptr);