]> cloud.milkyroute.net Git - dolphin.git/commitdiff
KonqFileUndoManager moved to kdelibs, as KIO::FileUndoManager. Ported the code in...
authorDavid Faure <faure@kde.org>
Wed, 30 Apr 2008 23:32:33 +0000 (23:32 +0000)
committerDavid Faure <faure@kde.org>
Wed, 30 Apr 2008 23:32:33 +0000 (23:32 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=802881

src/dolphindropcontroller.cpp
src/dolphindropcontroller.h
src/dolphinfileplacesview.cpp
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinview.cpp
src/dolphinview.h

index a9fd94df51df832e0d90ef943e8655d9b11f24da..45a7092c7910b3d8787c1f5ab54d08eaaf6c6be7 100644 (file)
@@ -29,6 +29,7 @@
 // TODO replace with KonqOperations::doDrop [or move doDrop code into this class]
 // Note that this means changing the DolphinDropController controller usage
 // to "create with new and let it autodelete" instead of on stack, since doDrop is async.
+// NOTE: let's wait for KDirModel::dropEvent first.
 
 DolphinDropController::DolphinDropController(QWidget* parentWidget)
     : QObject(parentWidget), m_parentWidget(parentWidget)
@@ -107,17 +108,17 @@ void DolphinDropController::dropUrls(const KUrl::List& urls,
     switch (action) {
     case Qt::MoveAction:
         KonqOperations::copy(m_parentWidget, KonqOperations::MOVE, urls, destination);
-        emit doingOperation(KonqFileUndoManager::MOVE);
+        emit doingOperation(KIO::FileUndoManager::Move);
         break;
 
     case Qt::CopyAction:
         KonqOperations::copy(m_parentWidget, KonqOperations::COPY, urls, destination);
-        emit doingOperation(KonqFileUndoManager::COPY);
+        emit doingOperation(KIO::FileUndoManager::Copy);
         break;
 
     case Qt::LinkAction:
         KonqOperations::copy(m_parentWidget, KonqOperations::LINK, urls, destination);
-        emit doingOperation(KonqFileUndoManager::LINK);
+        emit doingOperation(KIO::FileUndoManager::Link);
         break;
 
     default:
index 0a3c237067281b4843050bdc8053234c83c76197..955d1614cab4604b98ef4321268be7fde84aebce 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <QObject>
 #include <kurl.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
 
 #include "libdolphin_export.h"
 
@@ -55,7 +55,7 @@ signals:
      * Is emitted when renaming, copying, moving, linking etc.
      * Used for feedback in the mainwindow.
      */
-    void doingOperation(KonqFileUndoManager::CommandType type);
+    void doingOperation(KIO::FileUndoManager::CommandType type);
 
 private:
     QWidget* m_parentWidget;
index 5dacae633bd698e1e7e73f6e05429b4204d7fa9e..a4f801c3abb9ce72e0c9b4c45565d0480f477d01 100644 (file)
@@ -39,8 +39,8 @@ void DolphinFilePlacesView::slotUrlsDropped(const KUrl& dest, QDropEvent* event,
 
     DolphinDropController dropController(parent);
     // forward doingOperation signal up to the mainwindow
-    connect(&dropController, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
-            this, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)));
+    connect(&dropController, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)),
+            this, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)));
     dropController.dropUrls(urls, dest);
 }
 
index 48956e0936803a0ea127cc4834956fc6dd00640f..43818f58042ea3319675fdcdf2fee9893f63cacf 100644 (file)
@@ -102,7 +102,7 @@ DolphinMainWindow::DolphinMainWindow(int id) :
     new MainWindowAdaptor(this);
     QDBusConnection::sessionBus().registerObject(QString("/dolphin/MainWindow%1").arg(m_id), this);
 
-    KonqFileUndoManager* undoManager = KonqFileUndoManager::self();
+    KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
     undoManager->setUiInterface(new UndoUiInterface());
 
     connect(undoManager, SIGNAL(undoAvailable(bool)),
@@ -133,7 +133,7 @@ void DolphinMainWindow::toggleViews()
     m_viewTab[m_tabIndex].secondaryView = container;
 }
 
-void DolphinMainWindow::slotDoingOperation(KonqFileUndoManager::CommandType commandType)
+void DolphinMainWindow::slotDoingOperation(KIO::FileUndoManager::CommandType commandType)
 {
     clearStatusBar();
     m_undoCommandTypes.append(commandType);
@@ -160,8 +160,8 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
                                  const KUrl& destination)
 {
     DolphinDropController dropController(this);
-    connect(&dropController, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
-            this, SLOT(slotDoingOperation(KonqFileUndoManager::CommandType)));
+    connect(&dropController, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)),
+            this, SLOT(slotDoingOperation(KIO::FileUndoManager::CommandType)));
     dropController.dropUrls(urls, destination);
 }
 
@@ -387,31 +387,31 @@ void DolphinMainWindow::slotUndoAvailable(bool available)
     }
 
     if (available && (m_undoCommandTypes.count() > 0)) {
-        const KonqFileUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
+        const KIO::FileUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
         DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
         switch (command) {
-        case KonqFileUndoManager::COPY:
+        case KIO::FileUndoManager::Copy:
             statusBar->setMessage(i18nc("@info:status", "Copy operation completed."),
                                   DolphinStatusBar::OperationCompleted);
             break;
-        case KonqFileUndoManager::MOVE:
+        case KIO::FileUndoManager::Move:
             statusBar->setMessage(i18nc("@info:status", "Move operation completed."),
                                   DolphinStatusBar::OperationCompleted);
             break;
-        case KonqFileUndoManager::LINK:
+        case KIO::FileUndoManager::Link:
             statusBar->setMessage(i18nc("@info:status", "Link operation completed."),
                                   DolphinStatusBar::OperationCompleted);
             break;
-        case KonqFileUndoManager::TRASH:
+        case KIO::FileUndoManager::Trash:
             statusBar->setMessage(i18nc("@info:status", "Move to trash operation completed."),
                                   DolphinStatusBar::OperationCompleted);
             break;
-        case KonqFileUndoManager::RENAME:
+        case KIO::FileUndoManager::Rename:
             statusBar->setMessage(i18nc("@info:status", "Renaming operation completed."),
                                   DolphinStatusBar::OperationCompleted);
             break;
 
-        case KonqFileUndoManager::MKDIR:
+        case KIO::FileUndoManager::Mkdir:
             statusBar->setMessage(i18nc("@info:status", "Created folder."),
                                   DolphinStatusBar::OperationCompleted);
             break;
@@ -434,8 +434,8 @@ void DolphinMainWindow::slotUndoTextChanged(const QString& text)
 void DolphinMainWindow::undo()
 {
     clearStatusBar();
-    KonqFileUndoManager::self()->uiInterface()->setParentWidget(this);
-    KonqFileUndoManager::self()->undo();
+    KIO::FileUndoManager::self()->uiInterface()->setParentWidget(this);
+    KIO::FileUndoManager::self()->undo();
 }
 
 void DolphinMainWindow::cut()
@@ -1152,8 +1152,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
             this, SLOT(slotRequestItemInfo(KFileItem)));
     connect(view, SIGNAL(activated()),
             this, SLOT(toggleActiveView()));
-    connect(view, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
-            this, SLOT(slotDoingOperation(KonqFileUndoManager::CommandType)));
+    connect(view, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)),
+            this, SLOT(slotDoingOperation(KIO::FileUndoManager::CommandType)));
     connect(view, SIGNAL(tabRequested(const KUrl&)),
             this, SLOT(openNewTab(const KUrl&)));
 
@@ -1189,7 +1189,7 @@ QString DolphinMainWindow::tabName(const KUrl& url) const
 }
 
 DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
-    KonqFileUndoManager::UiInterface()
+    KIO::FileUndoManager::UiInterface()
 {
 }
 
@@ -1204,7 +1204,7 @@ void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
         DolphinStatusBar* statusBar = mainWin->activeViewContainer()->statusBar();
         statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
     } else {
-        KonqFileUndoManager::UiInterface::jobError(job);
+        KIO::FileUndoManager::UiInterface::jobError(job);
     }
 }
 
index 675b08bedf89ed178b2edc4b5880896e523f4a66..47fddf381aeaaf6f3327f7e92d54bdd0de9eee84 100644 (file)
@@ -28,7 +28,7 @@
 #include <config-nepomuk.h>
 
 #include <kfileitemdelegate.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
 #include <ksortablelist.h>
 #include <kxmlguiwindow.h>
 
@@ -323,7 +323,7 @@ private slots:
     void toggleActiveView();
 
     /** Called when the view is doing a file operation, like renaming, copying, moving etc. */
-    void slotDoingOperation(KonqFileUndoManager::CommandType type);
+    void slotDoingOperation(KIO::FileUndoManager::CommandType type);
 
     /**
      * Activates the tab with the index \a index, which means that the current view
@@ -388,7 +388,7 @@ private:
      * assures that all errors are shown in the status bar of Dolphin
      * instead as modal error dialog with an OK button.
      */
-    class UndoUiInterface : public KonqFileUndoManager::UiInterface
+    class UndoUiInterface : public KIO::FileUndoManager::UiInterface
     {
     public:
         UndoUiInterface();
@@ -418,7 +418,7 @@ private:
     DolphinViewActionHandler* m_actionHandler;
 
     /// remember pending undo operations until they are finished
-    QList<KonqFileUndoManager::CommandType> m_undoCommandTypes;
+    QList<KIO::FileUndoManager::CommandType> m_undoCommandTypes;
 };
 
 inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
index 28e50a0a2390dd2c9e2168123f2886086504c4ef..5dd81426fa575072b12c8a61eb6ba70191d706ca 100644 (file)
@@ -518,7 +518,7 @@ void DolphinView::renameSelectedItems()
         if (newName.isEmpty()) {
             emit errorMessage(dialog.errorString());
         } else {
-            // TODO: check how this can be integrated into KonqFileUndoManager/KonqOperations
+            // TODO: check how this can be integrated into KIO::FileUndoManager/KonqOperations
             // as one operation instead of n rename operations like it is done now...
             Q_ASSERT(newName.contains('#'));
 
@@ -536,7 +536,7 @@ void DolphinView::renameSelectedItems()
                     KUrl newUrl = oldUrl;
                     newUrl.setFileName(name);
                     KonqOperations::rename(this, oldUrl, newUrl);
-                    emit doingOperation(KonqFileUndoManager::RENAME);
+                    emit doingOperation(KIO::FileUndoManager::Rename);
                 }
             }
         }
@@ -566,14 +566,14 @@ void DolphinView::renameSelectedItems()
             KUrl newUrl = oldUrl;
             newUrl.setFileName(newName);
             KonqOperations::rename(this, oldUrl, newUrl);
-            emit doingOperation(KonqFileUndoManager::RENAME);
+            emit doingOperation(KIO::FileUndoManager::Rename);
         }
     }
 }
 
 void DolphinView::trashSelectedItems()
 {
-    emit doingOperation(KonqFileUndoManager::TRASH);
+    emit doingOperation(KIO::FileUndoManager::Trash);
     KonqOperations::del(this, KonqOperations::TRASH, selectedUrls());
 }
 
@@ -800,8 +800,8 @@ void DolphinView::dropUrls(const KUrl::List& urls,
 {
     DolphinDropController dropController(this);
     // forward doingOperation signal up to the mainwindow
-    connect(&dropController, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
-            this, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)));
+    connect(&dropController, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)),
+            this, SIGNAL(doingOperation(KIO::FileUndoManager::CommandType)));
     dropController.dropUrls(urls, destination);
 }
 
@@ -1163,11 +1163,11 @@ void DolphinView::pasteToUrl(const KUrl& url)
     const KUrl::List sourceUrls = KUrl::List::fromMimeData(mimeData);
     if (KonqMimeData::decodeIsCutSelection(mimeData)) {
         KonqOperations::copy(this, KonqOperations::MOVE, sourceUrls, url);
-        emit doingOperation(KonqFileUndoManager::MOVE);
+        emit doingOperation(KIO::FileUndoManager::Move);
         clipboard->clear();
     } else {
         KonqOperations::copy(this, KonqOperations::COPY, sourceUrls, url);
-        emit doingOperation(KonqFileUndoManager::COPY);
+        emit doingOperation(KIO::FileUndoManager::Copy);
     }
 }
 
index 048486354b18ff5e684d0b2f361575c83ee0960c..1fcdaa0879c20c441c054da0425fde71a9f268ed 100644 (file)
@@ -29,7 +29,7 @@
 #include <kparts/part.h>
 #include <kfileitem.h>
 #include <kfileitemdelegate.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
 #include <kio/job.h>
 
 #include <QBoxLayout>
@@ -496,7 +496,7 @@ signals:
      * Is emitted when renaming, copying, moving, linking etc.
      * Used for feedback in the mainwindow.
      */
-    void doingOperation(KonqFileUndoManager::CommandType type);
+    void doingOperation(KIO::FileUndoManager::CommandType type);
 
 protected:
     /** @see QWidget::mouseReleaseEvent */