From 25f7a9dc17f047715db0a06729151f8721513800 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Sat, 9 Oct 2010 17:30:03 +0200 Subject: - get rid of the selected bookmark in BookmarkOwner we can now create actions as we want and not only in a context menu - an important cleanup - validOpenUrl() is now useless --- src/paneltreeview.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/paneltreeview.cpp') diff --git a/src/paneltreeview.cpp b/src/paneltreeview.cpp index 8e4add2d..e44fa5fe 100644 --- a/src/paneltreeview.cpp +++ b/src/paneltreeview.cpp @@ -100,12 +100,12 @@ void PanelTreeView::mouseReleaseEvent(QMouseEvent *event) return; if (event->button() == Qt::MidButton || event->modifiers() == Qt::ControlModifier) - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewTab); + emit openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewTab); else if (event->button() == Qt::LeftButton) { if (model()->rowCount(index) == 0) - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); + emit openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); else setExpanded(index, !isExpanded(index)); } @@ -123,7 +123,7 @@ void PanelTreeView::keyPressEvent(QKeyEvent *event) if (event->key() == Qt::Key_Return) { if (model()->rowCount(index) == 0) - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); + openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); else setExpanded(index, !isExpanded(index)); } @@ -135,16 +135,6 @@ void PanelTreeView::keyPressEvent(QKeyEvent *event) } -void PanelTreeView::validOpenUrl(const KUrl &url, Rekonq::OpenType openType) -{ - // To workaround a crash when the url is about:blank - if (url.url() == "about:blank") - emit openUrl(KUrl("about:home"), openType); - else - emit openUrl(url, openType); -} - - void PanelTreeView::mouseMoveEvent(QMouseEvent *event) { QTreeView::mouseMoveEvent(event); @@ -164,7 +154,7 @@ void PanelTreeView::openInCurrentTab() if (!index.isValid()) return; - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); + emit openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); } @@ -185,7 +175,7 @@ void PanelTreeView::openInNewTab() if (!index.isValid()) return; - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewTab); + emit openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewTab); } @@ -195,5 +185,5 @@ void PanelTreeView::openInNewWindow() if (!index.isValid()) return; - validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewWindow); + emit openUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewWindow); } -- cgit v1.2.1