From: Peter Penz Date: Sun, 1 Apr 2007 18:51:26 +0000 (+0000) Subject: implement renaming, moving to trash and deleting for the treeview panel X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/acc54fc38bb32d8774af44366246f92cd75b0b22?ds=sidebyside implement renaming, moving to trash and deleting for the treeview panel svn path=/trunk/KDE/kdebase/apps/; revision=648956 --- 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()