summaryrefslogtreecommitdiffstats
path: root/konqueror/listview/konq_listviewwidget.cc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2013-11-09 01:32:09 +0100
committerSlávek Banko <slavek.banko@axis.cz>2013-11-09 01:32:16 +0100
commitb42f6dbb134e3e1769b5483eaff511bb9103ad84 (patch)
tree1309c8c9f5e0c7a1f087913aab64dcae4e56376a /konqueror/listview/konq_listviewwidget.cc
parent7d025dfef0cee534e3c973e01e98bae8fd73f41c (diff)
downloadtdebase-b42f6dbb134e3e1769b5483eaff511bb9103ad84.tar.gz
tdebase-b42f6dbb134e3e1769b5483eaff511bb9103ad84.zip
Enhance renaming in Konqueror listview
This resolves Bug 1677
Diffstat (limited to 'konqueror/listview/konq_listviewwidget.cc')
-rw-r--r--konqueror/listview/konq_listviewwidget.cc45
1 files changed, 40 insertions, 5 deletions
diff --git a/konqueror/listview/konq_listviewwidget.cc b/konqueror/listview/konq_listviewwidget.cc
index d07edcbd6..352552f2e 100644
--- a/konqueror/listview/konq_listviewwidget.cc
+++ b/konqueror/listview/konq_listviewwidget.cc
@@ -125,17 +125,20 @@ KonqBaseListViewWidget::KonqBaseListViewWidget( KonqListView *parent, TQWidget *
#endif
connect( this, TQT_SIGNAL(returnPressed( TQListViewItem * )),
this, TQT_SLOT(slotReturnPressed( TQListViewItem * )) );
- connect( this, TQT_SIGNAL( mouseButtonClicked( int, TQListViewItem *, const TQPoint&, int )),
- this, TQT_SLOT( slotMouseButtonClicked2( int, TQListViewItem *, const TQPoint&, int )) );
+ connect( this, TQT_SIGNAL(mouseButtonClicked( int, TQListViewItem *, const TQPoint&, int )),
+ this, TQT_SLOT(slotMouseButtonClicked2( int, TQListViewItem *, const TQPoint&, int )) );
connect( this, TQT_SIGNAL(executed( TQListViewItem * )),
this, TQT_SLOT(slotExecuted( TQListViewItem * )) );
-
connect( this, TQT_SIGNAL(currentChanged( TQListViewItem * )),
this, TQT_SLOT(slotCurrentChanged( TQListViewItem * )) );
connect( this, TQT_SIGNAL(itemRenamed( TQListViewItem *, const TQString &, int )),
this, TQT_SLOT(slotItemRenamed( TQListViewItem *, const TQString &, int )) );
connect( this, TQT_SIGNAL(contextMenuRequested( TQListViewItem *, const TQPoint&, int )),
this, TQT_SLOT(slotPopupMenu( TQListViewItem *, const TQPoint&, int )) );
+ connect( this, TQT_SIGNAL(renameNext( TQListViewItem *, int )),
+ this, TQT_SLOT(slotRenameNextItem( TQListViewItem*, int)) );
+ connect( this, TQT_SIGNAL(renamePrev( TQListViewItem *, int )),
+ this, TQT_SLOT(slotRenamePrevItem( TQListViewItem*, int)) );
connect( this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()) );
connect( horizontalScrollBar(), TQT_SIGNAL(valueChanged( int )),
@@ -878,6 +881,38 @@ void KonqBaseListViewWidget::slotItemRenamed( TQListViewItem *item, const TQStri
setFocus();
}
+void KonqBaseListViewWidget::slotRenameNextItem(TQListViewItem *item, int)
+{
+ TQListViewItem *nextItem = item->itemBelow();
+ if (!nextItem)
+ {
+ nextItem=this->firstChild();
+ if (!nextItem)
+ return;
+ }
+
+ setCurrentItem(nextItem);
+ ListViewBrowserExtension *lvbe = dynamic_cast<ListViewBrowserExtension*>(m_pBrowserView->m_extension);
+ if (lvbe)
+ lvbe->rename();
+}
+
+void KonqBaseListViewWidget::slotRenamePrevItem(TQListViewItem *item, int)
+{
+ TQListViewItem *prevItem = item->itemAbove();
+ if (!prevItem)
+ {
+ prevItem=this->lastItem();
+ if (!prevItem)
+ return;
+ }
+
+ setCurrentItem(prevItem);
+ ListViewBrowserExtension *lvbe = dynamic_cast<ListViewBrowserExtension*>(m_pBrowserView->m_extension);
+ if (lvbe)
+ lvbe->rename();
+}
+
void KonqBaseListViewWidget::reportItemCounts()
{
KFileItemList lst = selectedFileItems();
@@ -1025,8 +1060,8 @@ void KonqBaseListViewWidget::slotReturnPressed( TQListViewItem *_item )
void KonqBaseListViewWidget::slotPopupMenu( TQListViewItem *i, const TQPoint &point, int c )
{
- kdDebug(1202) << "KonqBaseListViewWidget::slotPopupMenu" << endl;
- popupMenu( point, ( i != 0 && c == -1 ) ); // i != 0 && c == -1 when activated by keyboard
+ kdDebug(1202) << "KonqBaseListViewWidget::slotPopupMenu" << endl;
+ popupMenu( point, ( i != 0 && c == -1 ) ); // i != 0 && c == -1 when activated by keyboard
}
void KonqBaseListViewWidget::popupMenu( const TQPoint& _global, bool alwaysForSelectedFiles )