diff options
| author | Peter Penz <[email protected]> | 2008-06-10 16:23:46 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-06-10 16:23:46 +0000 |
| commit | c4f8d95a602a35c019c9697ce42d37bc4713148a (patch) | |
| tree | e966013d61f14d05630a25f3c2765d60af849eb3 /src | |
| parent | 8a8c615e3763e9a3c444660fdf614d956187fbcf (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')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 10 | ||||
| -rw-r--r-- | src/dolphinview.cpp | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 07011e7a5..57926d33e 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -458,16 +458,6 @@ void DolphinMainWindow::updatePasteAction() QPair<bool, QString> pasteInfo = m_activeViewContainer->view()->pasteInfo(); pasteAction->setEnabled(pasteInfo.first); pasteAction->setText(pasteInfo.second); - - if (pasteAction->isEnabled()) { - // disable the paste action if no writing is supported - const KUrl& url = m_activeViewContainer->view()->url(); - KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url); - KFileItemList list; - list.append(item); - KonqFileItemCapabilities capabilities(list); - pasteAction->setEnabled(capabilities.supportsWriting()); - } } void DolphinMainWindow::selectAll() 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") : |
