From 396bc0c1721af8d3ee970228e7df457f6b2c73d5 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 13 Apr 2020 15:44:09 +0300 Subject: Rewrite Session backend Add session.hpp, containing structs that describe session data MainWindow, SubWindow and WebView can be created from Session::structs Opening new window will automatically open a default subwindow and tab if none were specified Add lib/session_formats Add JsonSession, to serialize/deserialize Session structs into JSON - add some tests clang-tidy: - fix various warnings - disable modernize-use-trailing-return-type check --- src/webengine/webview.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/webengine/webview.h') diff --git a/src/webengine/webview.h b/src/webengine/webview.h index 0223b78..5748691 100644 --- a/src/webengine/webview.h +++ b/src/webengine/webview.h @@ -11,26 +11,32 @@ #include "webpage.h" #include +#include class WebProfile; class SubWindow; class WebViewContextMenu; -class WebView : public QWebEngineView +class WebView final : public QWebEngineView { friend class WebViewContextMenu; Q_OBJECT + explicit WebView(QWidget *parent = nullptr); + public: explicit WebView(WebProfile *profile = nullptr, QWidget *parent = nullptr); + explicit WebView(const Session::WebView &data, QWidget *parent = nullptr); ~WebView() = default; - WebProfile *profile() const + [[nodiscard]] WebProfile *profile() const { return m_profile; } void setProfile(WebProfile *profile); + [[nodiscard]] Session::WebView serialize() const; + bool isLoaded() const; public slots: -- cgit v1.2.1