summaryrefslogtreecommitdiff
path: root/src/paneltreeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/paneltreeview.cpp')
-rw-r--r--src/paneltreeview.cpp22
1 files changed, 6 insertions, 16 deletions
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);
}