OSDN Git Service

libs: deal with TODOs related to KonqOperations
authorIvailo Monev <xakepa10@gmail.com>
Fri, 23 Sep 2022 11:58:11 +0000 (14:58 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 23 Sep 2022 11:58:11 +0000 (14:58 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
dolphin/src/views/dolphinview.cpp
libs/konq/konq_operations.cpp
libs/konq/konq_operations.h

index 9c19fb6..da91547 100644 (file)
@@ -1441,7 +1441,7 @@ void DolphinView::slotRoleEditingFinished(int index, const QByteArray& role, con
                 m_model->setData(index, data);
             }
 
-            KonqOperations* op = KonqOperations::renameV2(this, oldUrl, newName);
+            KonqOperations* op = KonqOperations::rename(this, oldUrl, newName);
             if (op && !newNameExistsAlready) {
                 // Only connect the renamingFailed signal if there is no item with the new name
                 // in the model yet, see bug 328262.
@@ -1582,7 +1582,7 @@ void DolphinView::applyModeToView()
 
 void DolphinView::pasteToUrl(const KUrl& url)
 {
-    KonqOperations* op = KonqOperations::doPasteV2(this, url);
+    KonqOperations* op = KonqOperations::doPaste(this, url);
     if (op) {
         m_clearSelectionBeforeSelectingNewItems = true;
         m_markFirstNewlySelectedItemAsCurrent = true;
index c9aa430..207c679 100644 (file)
@@ -133,12 +133,7 @@ KIO::SimpleJob* KonqOperations::mkdir( QWidget *parent, const KUrl & url )
     return job;
 }
 
-void KonqOperations::doPaste( QWidget * parent, const KUrl & destUrl, const QPoint &pos )
-{
-    (void) KonqOperations::doPasteV2( parent, destUrl, pos );
-}
-
-KonqOperations *KonqOperations::doPasteV2(QWidget *parent, const KUrl &destUrl, const QPoint &pos)
+KonqOperations *KonqOperations::doPaste( QWidget * parent, const KUrl & destUrl, const QPoint &pos )
 {
     QClipboard *clipboard = QApplication::clipboard();
     const QMimeData *data = clipboard->mimeData();
@@ -723,12 +718,7 @@ static QString translatePath( QString path ) // krazy:exclude=passbyvalue
     return path;
 }
 
-void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const KUrl& newurl )
-{
-    renameV2(parent, oldurl, newurl);
-}
-
-KonqOperations *KonqOperations::renameV2( QWidget * parent, const KUrl & oldurl, const KUrl& newurl )
+KonqOperations *KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const KUrl& newurl )
 {
     kDebug(1203) << "oldurl=" << oldurl << " newurl=" << newurl;
     if ( oldurl == newurl )
@@ -850,17 +840,12 @@ void KonqOperations::slotResult(KJob *job)
     deleteLater();
 }
 
-void KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const QString & name )
-{
-    renameV2(parent, oldurl, name);
-}
-
-KonqOperations *KonqOperations::renameV2( QWidget * parent, const KUrl & oldurl, const QString & name )
+KonqOperations *KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const QString & name )
 {
     KUrl newurl( oldurl );
     newurl.setPath( oldurl.directory( KUrl::AppendTrailingSlash ) + name );
     kDebug(1203) << "KonqOperations::rename("<<name<<") called. newurl=" << newurl;
-    return renameV2( parent, oldurl, newurl );
+    return rename( parent, oldurl, newurl );
 }
 
 // Duplicated in libkfile's KDirOperator
index 5462c13..82d00a0 100644 (file)
 
 #include <kurl.h>
 #include <konq_export.h>
+#include <kio/job.h>
 
 #include <QtCore/QObject>
 #include <QtGui/qevent.h>
+#include <QtGui/QWidget>
 
 class KJob;
 namespace KIO { class Job; class SimpleJob; struct CopyInfo; }
-#include <QWidget>
 class KFileItem;
 class KFileItemListProperties;
 
@@ -108,6 +109,7 @@ public:
      * after the slot returns.
      *
      * @return The KonqOperations object
+     *
      * @since 4.3
      */
     static KonqOperations *doDrop( const KFileItem & destItem, const KUrl & destUrl, QDropEvent * ev, QWidget * parent,
@@ -115,23 +117,16 @@ public:
 
     /**
      * Paste the clipboard contents
-     */
-    static void doPaste( QWidget * parent, const KUrl & destUrl, const QPoint &pos = QPoint() );
-
-    /**
-     * Paste the clipboard contents
      *
      * @return The KonqOperations object
-     * @since 4.10
-     *
-     * @todo TODO KDE 5,0 - Merge doPaste and doPasteV2
      */
-    static KonqOperations *doPasteV2(QWidget * parent, const KUrl & destUrl, const QPoint &pos = QPoint());
+    static KonqOperations *doPaste( QWidget * parent, const KUrl & destUrl, const QPoint &pos = QPoint() );
 
     /**
      * 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 KUrl& targetUrl);
@@ -185,31 +180,10 @@ public:
      * @param parent the parent widget, passed to KonqOperations ctor
      * @param oldurl the current url of the file to be renamed
      * @param name the new name for the file. Shouldn't include '/'.
-     */
-    static void rename( QWidget * parent, const KUrl & oldurl, const QString & name );
-
-    /**
-     * Do a renaming.
-     * @param parent the parent widget, passed to KonqOperations ctor
-     * @param oldurl the current url of the file to be renamed
-     * @param name the new name for the file. Shouldn't include '/'.
      *
      * @return The KonqOperations object
-     * @since 4.11
-     *
-     * @todo TODO KDE 5.0 - Merge rename and renameV2
-     */
-    static KonqOperations *renameV2( QWidget * parent, const KUrl & oldurl, const QString & name );
-
-    /**
-     * Do a renaming.
-     * @param parent the parent widget, passed to KonqOperations ctor
-     * @param oldurl the current url of the file to be renamed
-     * @param newurl the new url for the file
-     * Use this version if the other one wouldn't work :)  (e.g. because name could
-     * be a relative path, including a '/').
      */
-    static void rename( QWidget * parent, const KUrl & oldurl, const KUrl & newurl );
+    static KonqOperations *rename( QWidget * parent, const KUrl & oldurl, const QString & name );
 
     /**
      * Do a renaming.
@@ -220,11 +194,8 @@ public:
      * be a relative path, including a '/').
      *
      * @return The KonqOperations object
-     * @since 4.11
-     *
-     * @todo TODO KDE 5.0 - Merge rename and renameV2
      */
-    static KonqOperations *renameV2( QWidget * parent, const KUrl & oldurl, const KUrl & newurl );
+    static KonqOperations *rename( QWidget * parent, const KUrl & oldurl, const KUrl & newurl );
 
     enum ConfirmationType { DEFAULT_CONFIRMATION, SKIP_CONFIRMATION, FORCE_CONFIRMATION };
     /**
@@ -249,6 +220,7 @@ public:
 
     /**
      * Returns the position where the drop occurred.
+     *
      * @since 4.3
      */
     QPoint dropPosition() const;
@@ -312,8 +284,6 @@ private:
     KIOPasteInfo * m_pasteInfo;
 };
 
-#include <kio/job.h>
-
 /// Restore multiple trashed files
 class KonqMultiRestoreJob : public KIO::Job
 {