diff options
| author | Peter Penz <[email protected]> | 2007-04-01 19:08:49 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-04-01 19:08:49 +0000 |
| commit | 9d0718ad39585f9c343277c94f56659b82176fc7 (patch) | |
| tree | 73bd948d4d45b06127dd3b08041d46187bb3e76d /src/dolphinmainwindow.cpp | |
| parent | afb6f04770f0a056be70ab8da51f70e288f27d38 (diff) | |
use default 'do you really want to delete...' dialog from libkonq
svn path=/trunk/KDE/kdebase/apps/; revision=648962
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 4090d6939..5a78ff98e 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -460,36 +460,12 @@ void DolphinMainWindow::deleteItems() { clearStatusBar(); - // TODO: if KonqOperations::askDeleteConfirmation() would indicate when - // the operation has been finished, this method should be used. + const KUrl::List list = m_activeView->selectedUrls(); + const bool del = KonqOperations::askDeleteConfirmation(list, + KonqOperations::DEL, + KonqOperations::FORCE_CONFIRMATION, + this); - KUrl::List list = m_activeView->selectedUrls(); - const uint itemCount = list.count(); - Q_ASSERT(itemCount >= 1); - - QString text; - if (itemCount > 1) { - text = i18n("Do you really want to delete the %1 selected items?", itemCount); - } - else { - const KUrl& url = list.first(); - QString itemName; - if (url.protocol() == "trash" ) { - itemName = url.path(); - // TODO: check comment in konq_undo.cc in the method askDeleteConfirmation() - itemName.remove(QRegExp("^/[0-9]*-")); - } - else { - itemName = url.pathOrUrl(); - } - text = i18n("Do you really want to delete '%1'?", itemName); - } - - const bool del = KMessageBox::warningContinueCancel(this, - text, - QString(), - KGuiItem(i18n("Delete"), KIcon("edit-delete")) - ) == KMessageBox::Continue; if (del) { KIO::Job* job = KIO::del(list); connect(job, SIGNAL(result(KJob*)), |
