diff options
Diffstat (limited to 'src/application.hpp')
-rw-r--r-- | src/application.hpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/application.hpp b/src/application.hpp index e74350f1..ce4bbfd1 100644 --- a/src/application.hpp +++ b/src/application.hpp @@ -11,7 +11,9 @@ #pragma once +#include "mainwindow/rekonqwindow.h" #include "rekonq.hpp" +#include <QPointer> #include <QUrl> #include <QWidget> #include <SingleApplication> @@ -19,13 +21,13 @@ // Forward Declarations class rView; class PluginLoader; -// class RekonqWindow; // class WebTab; // class WebPage; -// typedef QList< QWeakPointer<RekonqWindow> > RekonqWindowList; -// typedef QList<WebTab *> WebAppList; +typedef QList<QPointer<PluginLoader>> RekonqPluginList; +typedef QList<QPointer<RekonqWindow>> RekonqWindowList; +typedef QList<QPointer<rView>> RekonqViewList; // --------------------------------------------------------------------------------------------------------------- @@ -40,12 +42,14 @@ public: ~Application() override; bool registerPlugin(const QString &path); + [[nodiscard]] auto pluginList() const { return m_plugins; }; // int newInstance(); - [[deprecated]] static Application *instance() { return (qobject_cast<Application *>(QCoreApplication::instance())); } + static Application *instance() { return (qobject_cast<Application *>(QCoreApplication::instance())); } // RekonqWindow *rekonqWindow(const QString &activityID = QString()); - // RekonqWindowList rekonqWindowList(); + [[nodiscard]] auto windowList() const { return m_windows; } + [[nodiscard]] auto viewList() const { return m_views; } /** * @returns the list of windows associated with activity whose id is @param activityID @@ -90,7 +94,8 @@ public slots: // RekonqWindow *newWindow(bool withTab = true, bool PrivateBrowsingMode = false); // RekonqWindow *newWindow(WebPage *pg); - rView *newWebApp(const QUrl &url = QUrl()); + RekonqWindow *newWindow(); + rView *newView(const QUrl &url = QUrl(), RekonqWindow *window = nullptr); // void createWebAppShortcut(const QString & urlString = QString(), const QString & titleString = QString()); @@ -117,7 +122,7 @@ private slots: // void pageCreated(WebPage *); private: - QList<PluginLoader *> m_plugins; - // RekonqWindowList m_rekonqWindows; - QList<rView *> m_webApps; + RekonqPluginList m_plugins; + RekonqWindowList m_windows; + RekonqViewList m_views; }; |