[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-baseapps/frameworks] lib/konq/src: Remove KonqOperations::pasteInfo.
From:       David Faure <faure () kde ! org>
Date:       2014-10-21 20:13:52
Message-ID: E1XgfoW-0001hk-IQ () scm ! kde ! org
[Download RAW message or body]

Git commit b24597d995bf99c98ac82406fcb9e3f23da0e838 by David Faure.
Committed on 21/10/2014 at 20:03.
Pushed by dfaure into branch 'frameworks'.

Remove KonqOperations::pasteInfo.

Replacement documented in https://community.kde.org/Frameworks/Porting_Notes#libkonq

M  +0    -39   lib/konq/src/konq_operations.cpp
M  +0    -8    lib/konq/src/konq_operations.h

http://commits.kde.org/kde-baseapps/b24597d995bf99c98ac82406fcb9e3f23da0e838

diff --git a/lib/konq/src/konq_operations.cpp b/lib/konq/src/konq_operations.cpp
index 0f2f918..ebb162d 100644
--- a/lib/konq/src/konq_operations.cpp
+++ b/lib/konq/src/konq_operations.cpp
@@ -587,42 +587,3 @@ QWidget* KonqOperations::parentWidget() const
     return static_cast<QWidget *>( parent() );
 }
 
-QPair<bool, QString> KonqOperations::pasteInfo(const QUrl& targetUrl)
-{
-    QPair<bool, QString> ret;
-    QClipboard* clipboard = QApplication::clipboard();
-    const QMimeData* mimeData = clipboard->mimeData();
-
-    bool canPasteData = false;
-    QList<QUrl> urls;
-
-    // mimeData can be 0 according to https://bugs.kde.org/show_bug.cgi?id=335053
-    if (mimeData) {
-        canPasteData = KIO::canPasteMimeData(mimeData);
-        urls = KUrlMimeData::urlsFromMimeData(mimeData);
-    } else {
-        kWarning(1203) << "QApplication::clipboard()->mimeData() is 0!";
-    }
-
-    if (!urls.isEmpty() || canPasteData) {
-        // disable the paste action if no writing is supported
-        KFileItem item(KFileItem::Unknown, KFileItem::Unknown, targetUrl);
-        ret.first = KFileItemListProperties(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") :
-                                        i18nc("@action:inmenu", "Paste One File");
-
-        } else if (!urls.isEmpty()) {
-            ret.second = i18ncp("@action:inmenu", "Paste One Item", "Paste %1 Items", urls.count());
-        } else {
-            ret.second = i18nc("@action:inmenu", "Paste Clipboard Contents...");
-        }
-    } else {
-        ret.first = false;
-        ret.second = i18nc("@action:inmenu", "Paste");
-    }
-
-    return ret;
-}
diff --git a/lib/konq/src/konq_operations.h b/lib/konq/src/konq_operations.h
index 57ba1a0..92663f1 100644
--- a/lib/konq/src/konq_operations.h
+++ b/lib/konq/src/konq_operations.h
@@ -95,14 +95,6 @@ public:
     static KonqOperations *doPaste(QWidget * parent, const QUrl & destUrl);
 
     /**
-     * Returns the state of the paste action:
-     * first is whether the action should be enabled
-     * second is the text for the action
-     * @since 4.3
-     */
-    static QPair<bool, QString> pasteInfo(const QUrl &targetUrl);
-
-    /**
      * Returns the list of dropped URL's.
      *
      * You can call this method on the object returned by KonqOperations::doDrop(),
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic