┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinpart.cpp
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2008-04-27 22:35:49 +0000
committerDavid Faure <[email protected]>2008-04-27 22:35:49 +0000
commit439fa3c47439ab22bfd9b2609008c3011ff4f496 (patch)
tree09bf562752fc10ce0d09fb76cc576866ff6fe69c /src/dolphinpart.cpp
parent3467159a73d73d2082f6848b90ce16f708e9b773 (diff)
don't allow to trash files which are inside trash:/ already
svn path=/trunk/KDE/kdebase/apps/; revision=801853
Diffstat (limited to 'src/dolphinpart.cpp')
-rw-r--r--src/dolphinpart.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index 41c6ff3a3..be89fcc5a 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -299,15 +299,17 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
KParts::BrowserExtension::ActionGroupMap actionGroups;
QList<QAction *> editActions;
- if (!item.isNull()) { // only for context menu on one or more items
+ if (!_item.isNull()) { // only for context menu on one or more items
// TODO if ( sMoving )
editActions.append(actionCollection()->action("rename"));
bool addTrash = false;
bool addDel = false;
- // TODO if ( sMoving && !isIntoTrash && !isTrashLink )
- addTrash = true;
+ bool isIntoTrash = _item.url().protocol() == "trash";
+
+ if ( /*TODO sMoving &&*/ !isIntoTrash )
+ addTrash = true;
/* TODO if ( sDeleting ) */ {
if ( !item.isLocalFile() )
@@ -328,18 +330,18 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
if (addDel)
editActions.append(actionCollection()->action("delete"));
actionGroups.insert("editactions", editActions);
-
- // TODO: We should change the signature of the slots (and signals) for being able
- // to tell for which items we want a popup.
- KFileItemList items = (m_view->selectedItems().count() ? m_view->selectedItems()
- : KFileItemList() << item);
- emit m_extension->popupMenu(QCursor::pos(),
- items,
- KParts::OpenUrlArguments(),
- KParts::BrowserArguments(),
- popupFlags,
- actionGroups);
}
+
+ // TODO: We should change the signature of the slots (and signals) for being able
+ // to tell for which items we want a popup.
+ KFileItemList items = (m_view->selectedItems().count() ? m_view->selectedItems()
+ : KFileItemList() << item);
+ emit m_extension->popupMenu(QCursor::pos(),
+ items,
+ KParts::OpenUrlArguments(),
+ KParts::BrowserArguments(),
+ popupFlags,
+ actionGroups);
}
void DolphinPart::slotUrlChanged(const KUrl& url)