From 3323b83af3bc0cd4feff0e0463718e77d4eabef7 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 20 Dec 2017 12:53:40 +0100 Subject: Can now open links in new tab --- src/mainwindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/mainwindow.cpp') 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(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); -- cgit v1.2.1