┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-06-10 16:23:46 +0000
committerPeter Penz <[email protected]>2008-06-10 16:23:46 +0000
commitc4f8d95a602a35c019c9697ce42d37bc4713148a (patch)
treee966013d61f14d05630a25f3c2765d60af849eb3 /src/dolphinview.cpp
parent8a8c615e3763e9a3c444660fdf614d956187fbcf (diff)
Move code for disabling the paste action into DolphinView::pasteInfo() -> Dolphin KPart now also is aware about the disabled paste action.
@David: Konqueror hides the paste action in the context menu now, but still the action in the edit menu stays enabled CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=819116
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index bfca285cf..514f52009 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -41,6 +41,7 @@
#include <kmenu.h>
#include <kmessagebox.h>
#include <kmimetyperesolver.h>
+#include <konq_fileitemcapabilities.h>
#include <konq_operations.h>
#include <konqmimedata.h>
#include <ktoggleaction.h>
@@ -901,7 +902,10 @@ QPair<bool, QString> DolphinView::pasteInfo() const
KUrl::List urls = KUrl::List::fromMimeData(mimeData);
if (!urls.isEmpty()) {
- ret.first = true;
+ // disable the paste action if no writing is supported
+ KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url());
+ ret.first = KonqFileItemCapabilities(KFileItemList() << item).supportsWriting();
+
if (urls.count() == 1) {
const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, urls.first(), true);
ret.second = item.isDir() ? i18nc("@action:inmenu", "Paste One Folder") :