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

List:       kde-commits
Subject:    [kde-baseapps/frameworks] lib/konq/src: Remove KonqOperations::rename/renameV2. All users have been 
From:       David Faure <faure () kde ! org>
Date:       2014-09-23 6:12:19
Message-ID: E1XWJKl-0001Mh-BG () scm ! kde ! org
[Download RAW message or body]

Git commit 28f03193702eaeb9674e62e07987d168d0b54f7e by David Faure.
Committed on 04/09/2014 at 16:48.
Pushed by dfaure into branch 'frameworks'.

Remove KonqOperations::rename/renameV2. All users have been ported.

M  +0    -53   lib/konq/src/konq_operations.cpp
M  +1    -48   lib/konq/src/konq_operations.h

http://commits.kde.org/kde-baseapps/28f03193702eaeb9674e62e07987d168d0b54f7e

diff --git a/lib/konq/src/konq_operations.cpp b/lib/konq/src/konq_operations.cpp
index 55a384a..2df103c 100644
--- a/lib/konq/src/konq_operations.cpp
+++ b/lib/konq/src/konq_operations.cpp
@@ -579,37 +579,6 @@ 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 )
-{
-    kDebug(1203) << "oldurl=" << oldurl << " newurl=" << newurl;
-    if ( oldurl == newurl )
-        return 0;
-
-    KUrl::List lst;
-    lst.append(oldurl);
-    KIO::Job * job = KIO::moveAs( oldurl, newurl, oldurl.isLocalFile() ? \
                KIO::HideProgressInfo : KIO::DefaultFlags );
-    KonqOperations * op = new KonqOperations( parent );
-    op->setOperation( job, RENAME, newurl );
-    KIO::FileUndoManager::self()->recordJob( KIO::FileUndoManager::Rename, lst, \
                newurl, job );
-    // if moving the desktop then update config file and emit
-    if ( oldurl.isLocalFile() && oldurl.toLocalFile( KUrl::AddTrailingSlash ) == \
                KGlobalSettings::desktopPath() )
-    {
-        kDebug(1203) << "That rename was the Desktop path, updating config files";
-        //save in XDG path
-        const QString userDirsFile(KGlobal::dirs()->localxdgconfdir() + \
                QLatin1String("user-dirs.dirs"));
-        KConfig xdgUserConf( userDirsFile, KConfig::SimpleConfig );
-        KConfigGroup g( &xdgUserConf, "" );
-        g.writeEntry( "XDG_DESKTOP_DIR", QString("\"" + translatePath( newurl.path() \
                ) + "\"") );
-        KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, \
                KGlobalSettings::SETTINGS_PATHS);
-    }
-
-    return op;
-}
 
 void KonqOperations::setOperation( KIO::Job * job, Operation method, const KUrl & \
dest )  {
@@ -674,15 +643,6 @@ void KonqOperations::slotResult(KJob *job)
             }
         }
         break;
-    case RENAME: {
-            KIO::CopyJob *renameJob = qobject_cast<KIO::CopyJob*>(job);
-            if (renameJob && jobFailed) {
-                const KUrl oldUrl = renameJob->srcUrls().first();
-                const KUrl newUrl = renameJob->destUrl();
-                emit renamingFailed(oldUrl, newUrl);
-            }
-        }
-        break;
     default:
         break;
     }
@@ -696,19 +656,6 @@ 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 )
-{
-    KUrl newurl( oldurl );
-    newurl.setPath( oldurl.directory( KUrl::AppendTrailingSlash ) + name );
-    kDebug(1203) << "KonqOperations::rename("<<name<<") called. newurl=" << newurl;
-    return renameV2( parent, oldurl, newurl );
-}
-
 // Duplicated in libkfile's KDirOperator
 static bool confirmCreatingHiddenDir(const QString& name, QWidget* parent)
 {
diff --git a/lib/konq/src/konq_operations.h b/lib/konq/src/konq_operations.h
index df908f2..30dee91 100644
--- a/lib/konq/src/konq_operations.h
+++ b/lib/konq/src/konq_operations.h
@@ -53,7 +53,7 @@ public:
      */
     static void editMimeType( const QString & mimeType, QWidget* parent );
 
-    enum Operation { TRASH, DEL, COPY, MOVE, LINK, EMPTYTRASH, STAT, MKDIR, RESTORE, \
UNKNOWN, PUT, RENAME }; +    enum Operation { TRASH, DEL, COPY, MOVE, LINK, \
EMPTYTRASH, STAT, MKDIR, RESTORE, UNKNOWN, PUT };  /**
      * Drop
      * @param destItem destination KFileItem for the drop (background or item)
@@ -147,52 +147,6 @@ public:
     static void statUrl( const KUrl & url, const QObject *receiver, const char \
*member, QWidget* parent );  
     /**
-     * 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 '/'.
-     */
-    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 \
                );
-
-    /**
-     * 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 '/').
-     *
-     * @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 );
-
-    /**
      * Returns the list of dropped URL's.
      *
      * You can call this method on the object returned by KonqOperations::doDrop(),
@@ -211,7 +165,6 @@ public:
 Q_SIGNALS:
     void statFinished( const KFileItem & item );
     void aboutToCreate(const KUrl::List &urls);
-    void renamingFailed(const KUrl &oldUrl, const KUrl &newUrl);
 
 private:
     QWidget* parentWidget() const;


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

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