X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fcontentwindow.cpp;fp=src%2Fcontentwindow.cpp;h=bb0f88abee6937b9628d592fe732b467b9aace5d;hb=79ecacaf4f47077ff0d4b04fdea2a060c7f6c69c;hp=2acc73e618e74c6268f893ffbd5734731a5cd50a;hpb=965fdd53bba9b739f10b060c92d73dc39645bd03;p=grr diff --git a/src/contentwindow.cpp b/src/contentwindow.cpp index 2acc73e..bb0f88a 100644 --- a/src/contentwindow.cpp +++ b/src/contentwindow.cpp @@ -126,9 +126,6 @@ class ViewportItem : public QGraphicsWidget, public QAbstractKineticScroller { m_widget->setPos(-p + m_overShoot); } - void cancelLeftMouseButtonPress(const QPoint & /*globalPressPos*/) { - } - void sendEvent(QGraphicsItem *i, QEvent *e) { m_ignoreEvents = true; scene()->sendEvent(i, e); @@ -230,9 +227,11 @@ ContentWindow::ContentWindow(QWidget *parent, Entry *e) : QMainWindow(parent) { /* TODO: Configurable text size ?? */ webview->settings()->setFontSize(QWebSettings::MinimumFontSize, 22); + webview->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); connect(webview, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool))); connect(webview, SIGNAL(loadStarted()), SLOT(loadStarted())); + connect(webview->page(), SIGNAL(linkClicked(const QUrl &)), SLOT(showLink(const QUrl &))); webview->setHtml(entry->content); @@ -255,10 +254,14 @@ void ContentWindow::loadFinished(bool) { setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false); } -void ContentWindow::seeOriginal() { +void ContentWindow::showLink(const QUrl &url) { /* Attempt to launch external browser */ - if(!QDesktopServices::openUrl(entry->link)) - webview->setUrl(entry->link); /* Failed... Show inline */ + if(!QDesktopServices::openUrl(url)) + webview->setUrl(url); /* Failed... Show inline */ +} + +void ContentWindow::seeOriginal() { + showLink(entry->link); } void ContentWindow::closeEvent(QCloseEvent *event) {