aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/webviewtabbar.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-06-24 10:23:13 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-06-24 10:23:13 +0200
commit7f686d7740cab02f92d158df487341dbc0513b61 (patch)
treee4a8e255309458ae4bc536652ed80d063a3e2753 /src/widgets/webviewtabbar.cpp
parentFixed crash when closing last tab (diff)
downloadsmolbote-7f686d7740cab02f92d158df487341dbc0513b61.tar.xz
Some MainWindow and WebViewTabBar cleanup
Diffstat (limited to 'src/widgets/webviewtabbar.cpp')
-rw-r--r--src/widgets/webviewtabbar.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp
index d57e095..4d3a859 100644
--- a/src/widgets/webviewtabbar.cpp
+++ b/src/widgets/webviewtabbar.cpp
@@ -22,7 +22,7 @@
#include "browser.h"
#include <QAction>
-WebViewTabBar::WebViewTabBar(QWebEngineProfile *profile, QWidget *parent) :
+WebViewTabBar::WebViewTabBar(WebEngineProfile *profile, QWidget *parent) :
QTabBar(parent)
{
m_profile = profile;
@@ -96,8 +96,10 @@ int WebViewTabBar::addTab(const QUrl &url)
return QTabBar::addTab("New Tab");
}
-void WebViewTabBar::setProfile(QWebEngineProfile *profile)
+void WebViewTabBar::setProfile(WebEngineProfile *profile)
{
+ Q_ASSERT(profile != nullptr);
+
m_profile = profile;
for(auto view : qAsConst(m_views)) {
QWebEnginePage *page = new QWebEnginePage(profile);
@@ -106,6 +108,11 @@ void WebViewTabBar::setProfile(QWebEngineProfile *profile)
}
}
+WebEngineProfile *WebViewTabBar::profile()
+{
+ return m_profile;
+}
+
WebView *WebViewTabBar::currentView()
{
return m_views.at(currentIndex());