diff options
Diffstat (limited to 'src/paneltreeview.cpp')
-rw-r--r-- | src/paneltreeview.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/paneltreeview.cpp b/src/paneltreeview.cpp index c13caf4d..d0d530fb 100644 --- a/src/paneltreeview.cpp +++ b/src/paneltreeview.cpp @@ -37,7 +37,7 @@ PanelTreeView::PanelTreeView(QWidget *parent) - : QTreeView(parent) + : QTreeView(parent) { connect(this, SIGNAL(itemHovered(const QString &)), parent, SIGNAL(itemHovered(const QString &))); connect(this, SIGNAL(openUrl(const KUrl &, Rekonq::OpenType)), parent, SIGNAL(openUrl(const KUrl &, Rekonq::OpenType))); @@ -60,22 +60,22 @@ void PanelTreeView::mousePressEvent(QMouseEvent *event) // A change of an item expansion is handle by mouseReleaseEvent() // So toggle again the item - if(expanded != isExpanded(index)) + if (expanded != isExpanded(index)) setExpanded(index, !isExpanded(index)); - - if(!index.isValid()) + + if (!index.isValid()) { clearSelection(); setCurrentIndex(QModelIndex()); - if(event->button() == Qt::RightButton) + if (event->button() == Qt::RightButton) emit contextMenuEmptyRequested(event->pos()); return; } - if(event->button() == Qt::RightButton) + if (event->button() == Qt::RightButton) { - if(model()->rowCount(index) == 0) + if (model()->rowCount(index) == 0) { // An empty group needs to be handle by the panels emit contextMenuItemRequested(event->pos()); @@ -93,15 +93,15 @@ void PanelTreeView::mouseReleaseEvent(QMouseEvent *event) QTreeView::mouseReleaseEvent(event); const QModelIndex index = indexAt(event->pos()); - if(!index.isValid()) + if (!index.isValid()) return; - if(event->button() == Qt::MidButton || event->modifiers() == Qt::ControlModifier) + if (event->button() == Qt::MidButton || event->modifiers() == Qt::ControlModifier) validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::SettingOpenTab); - else if(event->button() == Qt::LeftButton) + else if (event->button() == Qt::LeftButton) { - if(model()->rowCount(index) == 0) + if (model()->rowCount(index) == 0) validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); else setExpanded(index, !isExpanded(index)); @@ -114,18 +114,18 @@ void PanelTreeView::keyPressEvent(QKeyEvent *event) QTreeView::keyPressEvent(event); QModelIndex index = currentIndex(); - if(!index.isValid()) + if (!index.isValid()) return; - if(event->key() == Qt::Key_Return) + if (event->key() == Qt::Key_Return) { - if(model()->rowCount(index) == 0) + if (model()->rowCount(index) == 0) validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); else setExpanded(index, !isExpanded(index)); } - else if(event->key() == Qt::Key_Delete) + else if (event->key() == Qt::Key_Delete) { emit delKeyPressed(); } @@ -135,7 +135,7 @@ 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") + if (url.url() == "about:blank") emit openUrl(KUrl("about:home"), openType); else emit openUrl(url, openType); @@ -146,7 +146,7 @@ void PanelTreeView::mouseMoveEvent(QMouseEvent *event) { QTreeView::mouseMoveEvent(event); const QModelIndex index = indexAt(event->pos()); - if(!index.isValid()) + if (!index.isValid()) { emit itemHovered(""); return; @@ -158,7 +158,7 @@ void PanelTreeView::mouseMoveEvent(QMouseEvent *event) void PanelTreeView::openInCurrentTab() { QModelIndex index = currentIndex(); - if(!index.isValid()) + if (!index.isValid()) return; validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole))); @@ -168,7 +168,7 @@ void PanelTreeView::openInCurrentTab() void PanelTreeView::copyToClipboard() { QModelIndex index = currentIndex(); - if(!index.isValid()) + if (!index.isValid()) return; QClipboard *cb = QApplication::clipboard(); @@ -179,7 +179,7 @@ void PanelTreeView::copyToClipboard() void PanelTreeView::openInNewTab() { QModelIndex index = currentIndex(); - if(!index.isValid()) + if (!index.isValid()) return; validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::SettingOpenTab); @@ -189,8 +189,8 @@ void PanelTreeView::openInNewTab() void PanelTreeView::openInNewWindow() { QModelIndex index = currentIndex(); - if(!index.isValid()) + if (!index.isValid()) return; - validOpenUrl( qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewWindow); + validOpenUrl(qVariantValue< KUrl >(index.data(Qt::UserRole)), Rekonq::NewWindow); } |