mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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: faure@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=819116
This commit is contained in:
parent
875b1c77fb
commit
faeafd5b42
2 changed files with 5 additions and 11 deletions
|
@ -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()
|
||||
|
|
|
@ -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") :
|
||||
|
|
Loading…
Reference in a new issue