summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp42
1 files changed, 6 insertions, 36 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 16f7b6e5..4f6ba097 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -75,7 +75,7 @@ WebView::WebView(QWidget* parent)
connect(this, SIGNAL(loadProgress(int)), this, SLOT(setProgress(int)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- connect(this, SIGNAL(openUrlInNewTab(const KUrl &)), this, SLOT(load(const KUrl &)));
+ connect(this, SIGNAL(openUrlInNewTab(const KUrl &)), this, SLOT(openLinkInNewTab(const KUrl &)));
}
@@ -218,10 +218,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
}
-// void WebView::openLinkInNewTab()
-// {
-// pageAction(QWebPage::OpenLinkInNewWindow)->trigger();
-// }
+void WebView::openLinkInNewTab(const KUrl &url)
+{
+ Application::instance()->newWebView();
+ load(url);
+}
void WebView::loadFinished()
@@ -235,37 +236,6 @@ void WebView::loadFinished()
}
-// void WebView::mousePressEvent(QMouseEvent *event)
-// {
-// m_page->m_pressedButtons = event->buttons();
-// m_page->m_keyboardModifiers = event->modifiers();
-// QWebView::mousePressEvent(event);
-// }
-//
-//
-// void WebView::mouseReleaseEvent(QMouseEvent *event)
-// {
-// QWebView::mouseReleaseEvent(event);
-// if (!event->isAccepted() && (m_page->m_pressedButtons & Qt::MidButton))
-// {
-// KUrl url(QApplication::clipboard()->text(QClipboard::Selection));
-// if (!url.isEmpty() && url.isValid() && !url.scheme().isEmpty())
-// {
-// setUrl(url);
-// }
-// }
-// }
-
-
-// void WebView::downloadRequested(const QNetworkRequest &request)
-// {
-// KUrl srcUrl = request.url();
-// QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName();
-// KUrl destUrl = KUrl(path);
-// Application::downloadManager()->newDownload(srcUrl);
-// }
-
-
void WebView::keyPressEvent(QKeyEvent *event)
{
if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab))