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/session/sessiondialog.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/session/sessiondialog.h') diff --git a/src/session/sessiondialog.h b/src/session/sessiondialog.h index 9bf8a68..0a04940 100644 --- a/src/session/sessiondialog.h +++ b/src/session/sessiondialog.h @@ -1,7 +1,7 @@ /* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote + * location: https://library.iserlohn-fortress.net/aqua/smolbote.git * * SPDX-License-Identifier: GPL-3.0 */ @@ -9,6 +9,7 @@ #ifndef SMOLBOTE_SESSIONDIALOG_H #define SMOLBOTE_SESSIONDIALOG_H +#include "session.hpp" #include namespace Ui @@ -22,16 +23,20 @@ class SessionDialog : public QDialog public: explicit SessionDialog(QWidget *parent = nullptr); + explicit SessionDialog(const SessionDialog &) = delete; + explicit SessionDialog(SessionDialog &&) = delete; + SessionDialog &operator=(const SessionDialog &) = delete; + SessionDialog &operator=(SessionDialog &&) = delete; ~SessionDialog() override; - std::optional pickSession(); + std::optional> pickSession(); private slots: - QListWidgetItem *addItem(const QString &path); void search(const QString &text); - void openSession(const QString &filename); + static void openSession(const QString &filename); private: + const QString create_window_str; Ui::SessionDialog *ui; QMetaObject::Connection accepted_connection; }; -- cgit v1.2.1