diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-20 12:53:40 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-20 12:53:40 +0100 |
commit | 3323b83af3bc0cd4feff0e0463718e77d4eabef7 (patch) | |
tree | bea0abe418c808f8f089a642e098c993b29af143 /src/mainwindow.cpp | |
parent | Changed license from GPL3+ to GPL3 (diff) | |
download | smolbote-3323b83af3bc0cd4feff0e0463718e77d4eabef7.tar.xz |
Can now open links in new tab
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0e2abd7..3546f83 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -169,15 +169,18 @@ void MainWindow::newTab(const QUrl &url) m_tabBarAdded = true; ui->mainToolBar->addWidget(tabBar); } - tabBar->addTab(createWebView(url, m_profile.get())); + tabBar->addTab(createWebView(url, m_profile.get(), this)); } -void MainWindow::newWindow(const QUrl &url) +MainWindow *MainWindow::newWindow(const QUrl &url) { Browser *instance = static_cast<Browser*>(qApp->instance()); MainWindow *window = instance->createWindow(); window->setProfile(m_profile); - window->newTab(url); + if(!url.isEmpty()) { + window->newTab(url); + } + return window; } void MainWindow::focusAddress() @@ -282,8 +285,7 @@ void MainWindow::handleTabChanged(WebView *view) m_addressBar->setUrl(view->url()); m_addressBar->pageAction()->setMenu(view->pageMenu()); - connect(view, SIGNAL(titleChanged(QString)), this, SLOT(handleTitleUpdated(QString))); - connect(view, SIGNAL(linkHovered(QString)), ui->statusBar, SLOT(showMessage(QString))); + connect(view, &WebView::titleChanged, this, &MainWindow::handleTitleUpdated); m_progressBar->connectWebView(view); |