mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
BrowserWindow: Always create tab models in initialization
This commit is contained in:
parent
94e6b98450
commit
0f2728e49e
@ -56,6 +56,7 @@
|
||||
#include "mainmenu.h"
|
||||
#include "downloadsbutton.h"
|
||||
#include "tabmodel.h"
|
||||
#include "tabmrumodel.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -370,6 +371,10 @@ void BrowserWindow::setupUi()
|
||||
m_navigationToolbar = new NavigationBar(this);
|
||||
m_bookmarksToolbar = new BookmarksToolbar(this);
|
||||
|
||||
m_tabModel = new TabModel(this, this);
|
||||
m_tabMruModel = new TabMruModel(this, this);
|
||||
m_tabMruModel->setSourceModel(m_tabModel);
|
||||
|
||||
m_navigationContainer = new NavigationContainer(this);
|
||||
m_navigationContainer->addWidget(m_navigationToolbar);
|
||||
m_navigationContainer->addWidget(m_bookmarksToolbar);
|
||||
@ -718,14 +723,16 @@ QAction* BrowserWindow::action(const QString &name) const
|
||||
return m_mainMenu->action(name);
|
||||
}
|
||||
|
||||
TabModel *BrowserWindow::tabModel()
|
||||
TabModel *BrowserWindow::tabModel() const
|
||||
{
|
||||
if (!m_tabModel) {
|
||||
m_tabModel = new TabModel(this, this);
|
||||
}
|
||||
return m_tabModel;
|
||||
}
|
||||
|
||||
TabMruModel *BrowserWindow::tabMruModel() const
|
||||
{
|
||||
return m_tabMruModel;
|
||||
}
|
||||
|
||||
void BrowserWindow::setWindowTitle(const QString &t)
|
||||
{
|
||||
QString title = t;
|
||||
|
@ -52,6 +52,7 @@ class NavigationContainer;
|
||||
class ClickableLabel;
|
||||
class LocationBar;
|
||||
class TabModel;
|
||||
class TabMruModel;
|
||||
|
||||
class FALKON_EXPORT BrowserWindow : public QMainWindow
|
||||
{
|
||||
@ -121,7 +122,8 @@ public:
|
||||
|
||||
QAction* action(const QString &name) const;
|
||||
|
||||
TabModel *tabModel();
|
||||
TabModel *tabModel() const;
|
||||
TabMruModel *tabMruModel() const;
|
||||
|
||||
signals:
|
||||
void startingCompleted();
|
||||
@ -219,6 +221,7 @@ private:
|
||||
MainMenu* m_mainMenu;
|
||||
|
||||
TabModel *m_tabModel = nullptr;
|
||||
TabMruModel *m_tabMruModel = nullptr;
|
||||
|
||||
int m_sideBarWidth;
|
||||
int m_webViewWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user