From acc54fc38bb32d8774af44366246f92cd75b0b22 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 1 Apr 2007 18:51:26 +0000 Subject: implement renaming, moving to trash and deleting for the treeview panel svn path=/trunk/KDE/kdebase/apps/; revision=648956 --- src/treeviewcontextmenu.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/treeviewcontextmenu.cpp') diff --git a/src/treeviewcontextmenu.cpp b/src/treeviewcontextmenu.cpp index 290b6ec6c..561435ca2 100644 --- a/src/treeviewcontextmenu.cpp +++ b/src/treeviewcontextmenu.cpp @@ -27,6 +27,8 @@ #include #include +#include "renamedialog.h" + #include #include @@ -137,17 +139,29 @@ void TreeViewContextMenu::paste() void TreeViewContextMenu::rename() { - // TODO + const KUrl& oldUrl = m_fileInfo->url(); + RenameDialog dialog(oldUrl); + if (dialog.exec() == QDialog::Accepted) { + const QString& newName = dialog.newName(); + if (!newName.isEmpty()) { + KUrl newUrl = oldUrl.upUrl(); + newUrl.addPath(newName); + KonqOperations::rename(m_parent, oldUrl, newUrl); + } + } } void TreeViewContextMenu::moveToTrash() { - // TODO + KonqOperations::del(m_parent, KonqOperations::TRASH, m_fileInfo->url()); } void TreeViewContextMenu::deleteItem() { - // TODO + KonqOperations::askDeleteConfirmation(m_fileInfo->url(), + KonqOperations::DEL, + KonqOperations::FORCE_CONFIRMATION, + m_parent); } void TreeViewContextMenu::showProperties() -- cgit v1.3