diff options
| author | Peter Penz <[email protected]> | 2007-04-01 18:51:26 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-04-01 18:51:26 +0000 |
| commit | acc54fc38bb32d8774af44366246f92cd75b0b22 (patch) | |
| tree | b815a2a5c085ad70cb8655dbbd2915031540dbf1 /src | |
| parent | 4908c5e60cc55cb1bf7337418b87d1fc0ee1d734 (diff) | |
implement renaming, moving to trash and deleting for the treeview panel
svn path=/trunk/KDE/kdebase/apps/; revision=648956
Diffstat (limited to 'src')
| -rw-r--r-- | src/treeviewcontextmenu.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
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 <klocale.h> #include <kpropertiesdialog.h> +#include "renamedialog.h" + #include <QApplication> #include <QClipboard> @@ -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() |
