From: Peter Penz Date: Sun, 8 Jun 2008 15:20:19 +0000 (+0000) Subject: disable the paste action if no writing is supported for the paste-destination X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/ffe9bbacd9a27f3a2a8c349504a65e1c89e64503?ds=inline disable the paste action if no writing is supported for the paste-destination BUG: 161639 svn path=/trunk/KDE/kdebase/apps/; revision=818445 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 57926d33e..07011e7a5 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -458,6 +458,16 @@ void DolphinMainWindow::updatePasteAction() QPair 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()