From aa8198eec380659fd3538e058b50c24b0f88743c Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 1 Jul 2018 18:13:01 +0200 Subject: Code cleanup Clean up MainWindow Configuration is now a std::unique_ptr Connect downloads and request interceptor to all profiles --- src/mainwindow/mainwindow.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/mainwindow/mainwindow.h') diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index 287602a..d695dd8 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -22,6 +22,11 @@ class SearchForm; class WebView; class NavigationBar; class WebProfile; + +namespace Ui { +class MainWindow; +} + class MainWindow : public QMainWindow { friend class Browser; @@ -33,12 +38,10 @@ public: ToolsMenu }; - explicit MainWindow(std::shared_ptr &config, QWidget *parent = nullptr); + explicit MainWindow(const std::unique_ptr &config, QWidget *parent = nullptr); Q_DISABLE_COPY(MainWindow) ~MainWindow() override; - void createMenuBar(); - void addAction(ActionLocation where, QAction *action); void addDockWidget(Qt::DockWidgetArea area, QWidget *widget); void removeDockWidget(QWidget *widget); @@ -48,15 +51,16 @@ public: public slots: void createTab(const QUrl &url); - SubWindow *createSubWindow(WebProfile *profile); - SubWindow *createSubWindow(const QString &url = QString()); + SubWindow *createSubWindow(const std::unique_ptr &config, WebProfile *profile); +private slots: void setView(WebView *view); protected: void closeEvent(QCloseEvent *event) override; private: + Ui::MainWindow *ui; QAction *subWindowAction = nullptr; QMenu *toolsMenu = nullptr; @@ -67,8 +71,6 @@ private: QMdiArea *mdiArea; WebView *currentView = nullptr; - std::shared_ptr m_config; - QMetaObject::Connection viewChangedConnection; QMetaObject::Connection searchBoxConnection; QMetaObject::Connection statusBarConnection; -- cgit v1.2.1