]> cloud.milkyroute.net Git - dolphin.git/commitdiff
disable the paste action if no writing is supported for the paste-destination
authorPeter Penz <peter.penz19@gmail.com>
Sun, 8 Jun 2008 15:20:19 +0000 (15:20 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 8 Jun 2008 15:20:19 +0000 (15:20 +0000)
BUG: 161639

svn path=/trunk/KDE/kdebase/apps/; revision=818445

src/dolphinmainwindow.cpp

index 57926d33ec9901f7f2fe61b3046119b1d22108dc..07011e7a5791cdd9342e0ceb1fdbe705f1b029ce 100644 (file)
@@ -458,6 +458,16 @@ 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()