X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4908c5e60cc55cb1bf7337418b87d1fc0ee1d734..4eec2a77cfa8719f0cf7f6741c8cfa11b23ebf5b:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 4090d6939..f77d45c72 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -32,9 +32,11 @@ #include "metadatawidget.h" #include "mainwindowadaptor.h" #include "treeviewsidebarpage.h" -#include "urlnavigator.h" +#include "kurlnavigator.h" #include "viewpropertiesdialog.h" #include "viewproperties.h" +#include "kfileplacesmodel.h" +#include "kfileplacesview.h" #include "dolphin_generalsettings.h" @@ -460,36 +462,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::DEFAULT_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*)), @@ -1356,6 +1334,19 @@ void DolphinMainWindow::setupDockWidgets() infoDock->hide(); treeViewDock->hide(); } + + // FIXME: To merge with the current bookmark sidebar + QDockWidget *placesDock = new QDockWidget(i18n("Places")); + placesDock->setObjectName("placesDock"); + placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + KFilePlacesView *listView = new KFilePlacesView(placesDock); + placesDock->setWidget(listView); + listView->setModel(new KFilePlacesModel(listView)); + addDockWidget(Qt::LeftDockWidgetArea, placesDock); + connect(listView, SIGNAL(urlChanged(KUrl)), + this, SLOT(changeUrl(KUrl))); + connect(this, SIGNAL(urlChanged(KUrl)), + listView, SLOT(setUrl(KUrl))); } void DolphinMainWindow::updateHistory() @@ -1515,7 +1506,7 @@ void DolphinMainWindow::connectViewSignals(int viewIndex) connect(view, SIGNAL(urlChanged(KUrl)), this, SLOT(changeUrl(KUrl))); - const UrlNavigator* navigator = view->urlNavigator(); + const KUrlNavigator* navigator = view->urlNavigator(); connect(navigator, SIGNAL(urlChanged(const KUrl&)), this, SLOT(changeUrl(const KUrl&))); connect(navigator, SIGNAL(historyChanged()),