aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 10:21:30 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-05-28 10:21:30 +0200
commit49f1351231a71969160b2574603d198af3cf67b3 (patch)
tree3f74847f218efc8cf166f3f49e663177daefff41 /src/webengine
parentSwap to new tab after creating it (diff)
downloadsmolbote-49f1351231a71969160b2574603d198af3cf67b3.tar.xz
Remove Window::addTab(WebView *view)
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webview.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 1dca046..686a689 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -69,26 +69,24 @@ WebView *WebView::createWindow(QWebEnginePage::WebWindowType type)
}
// parent Window has been found
- WebView *view = new WebView(m_profile, m_parentWindow);
+ auto index = m_parentWindow->addTab();
+ WebView *view = m_parentWindow->view(index);
switch(type) {
case QWebEnginePage::WebBrowserWindow:
// a complete web browser window
- m_parentWindow->addTab(view);
break;
case QWebEnginePage::WebBrowserTab:
// a web browser tab
- m_parentWindow->swapToTab(m_parentWindow->addTab(view));
+ m_parentWindow->swapToTab(index);
break;
case QWebEnginePage::WebDialog:
// a window without decorations
- m_parentWindow->addTab(view);
break;
case QWebEnginePage::WebBrowserBackgroundTab:
// a web browser tab, but don't swap to it
- m_parentWindow->addTab(view);
break;
}