diff options
Diffstat (limited to 'src/browser.h')
-rw-r--r-- | src/browser.h | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/src/browser.h b/src/browser.h index dedb933..ee9e917 100644 --- a/src/browser.h +++ b/src/browser.h @@ -22,21 +22,16 @@ #define BROWSER_H #include "singleapplication.h" -#include <bookmarks/bookmarkswidget.h> -#include <downloads/downloadswidget.h> -#include "settings.h" +//#include <bookmarks/bookmarkswidget.h> +//#include <downloads/downloadswidget.h> #include "webengine/webengineprofile.h" -#include "filter/blockermanager.h" -#include "webengine/urlinterceptor.h" +//#include "filter/blockermanager.h" +//#include "webengine/urlinterceptor.h" +#include <QVector> #include <memory> -#include <QSharedPointer> - -#ifdef browser -#undef browser -#endif -#define browser Browser::instance() +#include "settings/configuration.h" class MainWindow; class Browser : public SingleApplication @@ -47,45 +42,35 @@ public: explicit Browser(int &argc, char *argv[]); ~Browser(); - QString applicationLongVersion() const; + void setConfiguration(std::shared_ptr<Configuration> &config); - void loadSettings(const QString &path); - void loadPlugins(); void loadProfiles(); - - static Browser *instance(); - - Settings *settings(); - BookmarksWidget *bookmarks(); - DownloadsWidget *downloads(); - BlockerManager *blocklists(); - - MainWindow *activeWindow(); - WebEngineProfile *profile(const QString name); - QStringList profiles(); + // QStringList profiles(); + +// std::shared_ptr<BookmarksWidget>& bookmarks(); +// std::shared_ptr<DownloadsWidget>& downloads(); +// BlockerManager *blocklists(); - QObject *plugin(const QString name); - QStringList plugins(); + //MainWindow *activeWindow(); public slots: - MainWindow* createWindow(const QHash<QString, QVariant> options); - void clean(); + MainWindow* createWindow(); private: Q_DISABLE_COPY(Browser) - std::unique_ptr<Settings> m_settings; + std::shared_ptr<Configuration> m_config; - QVector<QPointer<MainWindow>> m_windows; + QVector<MainWindow *> m_windows; +// QVector<QPointer<MainWindow>> m_windows; QHash<QString, WebEngineProfile *> m_profiles; + WebEngineProfile* m_defaultProfile; - UrlRequestInterceptor *m_urlRequestInterceptor = nullptr; - QSharedPointer<BookmarksWidget> m_bookmarksManager; - QSharedPointer<DownloadsWidget> m_downloadManager; - BlockerManager *m_blocklistManager = nullptr; - - QObject *m_plugin = nullptr; +// UrlRequestInterceptor *m_urlRequestInterceptor = nullptr; +// std::shared_ptr<BookmarksWidget> m_bookmarksManager; +// std::shared_ptr<DownloadsWidget> m_downloadManager; +// BlockerManager *m_blocklistManager = nullptr; }; |