// 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)
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:
#include <QObject>
#include <kurl.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
#include "libdolphin_export.h"
* 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;
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);
}
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)),
m_viewTab[m_tabIndex].secondaryView = container;
}
-void DolphinMainWindow::slotDoingOperation(KonqFileUndoManager::CommandType commandType)
+void DolphinMainWindow::slotDoingOperation(KIO::FileUndoManager::CommandType commandType)
{
clearStatusBar();
m_undoCommandTypes.append(commandType);
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);
}
}
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;
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()
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&)));
}
DolphinMainWindow::UndoUiInterface::UndoUiInterface() :
- KonqFileUndoManager::UiInterface()
+ KIO::FileUndoManager::UiInterface()
{
}
DolphinStatusBar* statusBar = mainWin->activeViewContainer()->statusBar();
statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
} else {
- KonqFileUndoManager::UiInterface::jobError(job);
+ KIO::FileUndoManager::UiInterface::jobError(job);
}
}
#include <config-nepomuk.h>
#include <kfileitemdelegate.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
#include <ksortablelist.h>
#include <kxmlguiwindow.h>
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
* 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();
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
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('#'));
KUrl newUrl = oldUrl;
newUrl.setFileName(name);
KonqOperations::rename(this, oldUrl, newUrl);
- emit doingOperation(KonqFileUndoManager::RENAME);
+ emit doingOperation(KIO::FileUndoManager::Rename);
}
}
}
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());
}
{
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);
}
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);
}
}
#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileitemdelegate.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
#include <kio/job.h>
#include <QBoxLayout>
* 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 */