From 77a27e730b2e8baed2a8b954e4da5bb162d9d824 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 4 Jun 2017 13:06:28 +0200 Subject: Browser class refactoring --- src/browser.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/browser.h') diff --git a/src/browser.h b/src/browser.h index 2c30bcc..75102c6 100644 --- a/src/browser.h +++ b/src/browser.h @@ -21,11 +21,10 @@ #ifndef BROWSER_H #define BROWSER_H -#include +#include "singleapplication.h" #include #include "forms/bookmarkswidget.h" #include "forms/downloadswidget.h" -#include #include "settings.h" #include #include "webengine/webengineprofile.h" @@ -38,7 +37,7 @@ #define sNetwork Browser::instance()->network() class MainWindow; -class Browser : public QApplication +class Browser : public SingleApplication { Q_OBJECT @@ -48,7 +47,9 @@ public: QString applicationLongVersion() const; - bool prepare(QStringList urls); + void setConfigPath(const QString &path); + void loadPlugins(); + void loadProfiles(); static Browser *instance(); @@ -58,24 +59,21 @@ public: DownloadsWidget *downloads(); BlockerManager *blocklists(); - void setConfigPath(const QString &path); - void addWindow(MainWindow* window); MainWindow *mainWindow(); WebEngineProfile *profile(const QString name); QStringList profiles(); - QObject *plugin(); + QObject *plugin(const QString name); + QStringList plugins(); public slots: + void addWindow(MainWindow* window); + void addWindow(const QStringList params); void removeWindow(MainWindow* window); -private slots: - void handleNewConnection(); - private: Settings *m_settings; - QLocalServer *m_localServer; QVector m_windows; QHash m_profiles; -- cgit v1.2.1