Logo Search packages:      
Sourcecode: d3lphin version File versions  Download package

void Dolphin::deleteItems (  )  [private, slot]

Deletes the selected items of the active view.

Definition at line 533 of file dolphin.cpp.

References DolphinView::selectedURLs(), slotDeleteFileFinished(), and slotHandleJobError().

{
    clearStatusBar();

    KURL::List list = m_activeView->selectedURLs();
    const uint itemCount = list.count();
    assert(itemCount >= 1);

    QString text;
    if (itemCount > 1) {
        text = i18n("Do you really want to delete the %1 selected items?").arg(itemCount);
    }
    else {
        const KURL& url = list.first();
        text = i18n("Do you really want to delete '%1'?").arg(url.fileName());
    }

    const bool del = KMessageBox::warningContinueCancel(this,
                                                        text,
                                                        QString::null,
                                                        KGuiItem(i18n("Delete"), SmallIcon("editdelete"))
                                                       ) == 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*)));
    }
}


Generated by  Doxygen 1.6.0   Back to index