/* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */
popup.exec(QCursor::pos());
selectedIndex = 0; // KD4-TODO: use QAction instead of switch below
+ // See libkonq/konq_operations.cc: KonqOperations::doDropFileCopy() (and doDrop, the main method)
}
if (selectedIndex < 0) {
) == KMessageBox::Continue;
if (del) {
KIO::Job* job = KIO::del(list);
- connect(job, SIGNAL(result(KIO::Job*)),
- this, SLOT(slotHandleJobError(KIO::Job*)));
- connect(job, SIGNAL(result(KIO::Job*)),
- this, SLOT(slotDeleteFileFinished(KIO::Job*)));
+ connect(job, SIGNAL(result(KJob*)),
+ this, SLOT(slotHandleJobError(KJob*)));
+ connect(job, SIGNAL(result(KJob*)),
+ this, SLOT(slotDeleteFileFinished(KJob*)));
}
}
close();
}
-void Dolphin::slotHandleJobError(KIO::Job* job)
+void Dolphin::slotHandleJobError(KJob* job)
{
if (job->error() != 0) {
m_activeView->statusBar()->setMessage(job->errorString(),
}
}
-void Dolphin::slotDeleteFileFinished(KIO::Job* job)
+void Dolphin::slotDeleteFileFinished(KJob* job)
{
if (job->error() == 0) {
m_activeView->statusBar()->setMessage(i18n("Delete operation completed."),
void Dolphin::cut()
{
+ // TODO: this boolean doesn't work between instances of dolphin or with konqueror or with other
+ // apps. The "application/x-kde-cutselection" mimetype should be used instead, see KonqMimeData
+ // in libkonq
m_clipboardContainsCutData = true;
/* KDE4-TODO: Q3DragObject* data = new KUrlDrag(m_activeView->selectedUrls(),
widget());
void Dolphin::paste()
{
- /* KDE4-TODO:
+ /* KDE4-TODO: - see KonqOperations::doPaste
QClipboard* clipboard = QApplication::clipboard();
QMimeSource* data = clipboard->data();
if (!KUrlDrag::canDecode(data)) {
else if (count == 1) {
// Only one file is selected. Pasting is only allowed if this
// file is a directory.
+ // TODO: this doesn't work with remote protocols; instead we need a
+ // m_activeView->selectedFileItems() to get the real KFileItems
const KFileItem fileItem(S_IFDIR,
KFileItem::Unknown,
urls.first(),
dlg.exec();
}
-void Dolphin::addUndoOperation(KIO::Job* job)
+void Dolphin::addUndoOperation(KJob* job)
{
if (job->error() != 0) {
slotHandleJobError(job);
// all source Urls must be updated with the trash Url. E. g. when moving
// a file "test.txt" and a second file "test.txt" to the trash,
// then the filenames in the trash are "0-test.txt" and "1-test.txt".
- QMap<QString, QString> metaData = job->metaData();
+ QMap<QString, QString> metaData;
+ KIO::Job *kiojob = qobject_cast<KIO::Job*>( job );
+ if ( kiojob )
+ {
+ metaData = kiojob->metaData();
+ }
KUrl::List newSourceUrls;
KUrl::List sourceUrls = command.source();
KToggleAction* detailsView = new KToggleAction(i18n("Details"), actionCollection(), "details");
detailsView->setShortcut(Qt::CTRL | Qt::Key_2);
detailsView->setIcon(KIcon("view_text"));
- connect(detailsView, SIGNAL(triggered()), this, SLOT(setIconsView()));
+ connect(detailsView, SIGNAL(triggered()), this, SLOT(setDetailsView()));
KToggleAction* previewsView = new KToggleAction(i18n("Previews"), actionCollection(), "previews");
previewsView->setShortcut(Qt::CTRL | Qt::Key_3);
unplugActionList("create_actions");
KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
- /* KDE4-TODO:
+ /* KDE4-TODO: don't port this code; use KNewMenu instead
while (it != end) {
CreateFileEntry entry = (*it).value();
KAction* action = new KAction(entry.name);
const KUrl::List& source,
const KUrl& dest)
{
- connect(job, SIGNAL(result(KIO::Job*)),
- this, SLOT(addUndoOperation(KIO::Job*)));
+ connect(job, SIGNAL(result(KJob*)),
+ this, SLOT(addUndoOperation(KJob*)));
UndoInfo undoInfo;
undoInfo.id = job->progressId();