diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-02-16 00:06:28 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-02-16 00:06:28 +0100 |
commit | 4150695c5fff0504cf19ad74b3f185bd67397497 (patch) | |
tree | 9cf5744503e83c3deea72820cd26cdd4d39fde0b /src/webview.cpp | |
parent | Modified adjam's mail (diff) | |
download | rekonq-4150695c5fff0504cf19ad74b3f185bd67397497.tar.xz |
new singleton Application class.
Try 1..
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index ab8ef5cd..850ff54b 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -76,21 +76,8 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r if ( type == QWebPage::NavigationTypeLinkClicked && (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) ) { - bool newWindow = (m_keyboardModifiers & Qt::AltModifier); - WebView *webView; - if (newWindow) - { - Application::instance()->newMainWindow(); - MainWindow *newMainWindow = Application::instance()->mainWindow(); - webView = newMainWindow->currentTab(); - newMainWindow->raise(); - newMainWindow->activateWindow(); - webView->setFocus(); - } - else - { - webView = mainWindow()->tabWidget()->newTab( true ); - } + WebView *webView = Application::instance()->newTab(); + webView->setFocus(); webView->load(request); m_keyboardModifiers = Qt::NoModifier; m_pressedButtons = Qt::NoButton; @@ -109,13 +96,16 @@ QWebPage *WebPage::createWindow(QWebPage::WebWindowType type) { Q_UNUSED(type); if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) + { m_openInNewTab = true; + } + if (m_openInNewTab) { m_openInNewTab = false; return mainWindow()->tabWidget()->newTab()->page(); } - Application::instance()->newMainWindow(); + MainWindow *mainWindow = Application::instance()->mainWindow(); return mainWindow->currentTab()->page(); } |