aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp12
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);