summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-02-16 00:06:28 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-02-16 00:06:28 +0100
commit4150695c5fff0504cf19ad74b3f185bd67397497 (patch)
tree9cf5744503e83c3deea72820cd26cdd4d39fde0b /src/webview.cpp
parentModified adjam's mail (diff)
downloadrekonq-4150695c5fff0504cf19ad74b3f185bd67397497.tar.xz
new singleton Application class.
Try 1..
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp22
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();
}