X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8cc479518be479365d91e5139f064fcce970d0a3..2f045c60109e0a5811f68bcce617236e3478e402:/src/panels/places/placespanel.cpp diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 0f5b83ad5..1f4d3d4b7 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -48,6 +50,7 @@ #include #include #include +#include PlacesPanel::PlacesPanel(QWidget* parent) : Panel(parent), @@ -332,6 +335,12 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even return; } + const PlacesItem* destItem = m_model->placesItem(index); + const PlacesItem::GroupType group = destItem->groupType(); + if (group == PlacesItem::SearchForType || group == PlacesItem::RecentlyAccessedType) { + return; + } + if (m_model->storageSetupNeeded(index)) { connect(m_model, SIGNAL(storageSetupDone(int,bool)), this, SLOT(slotItemDropEventStorageSetupDone(int,bool))); @@ -356,7 +365,7 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even return; } - KUrl destUrl = m_model->placesItem(index)->url(); + KUrl destUrl = destItem->url(); QDropEvent dropEvent(event->pos().toPoint(), event->possibleActions(), event->mimeData(), @@ -416,7 +425,7 @@ void PlacesPanel::slotTrashUpdated(KJob* job) if (job->error()) { emit errorMessage(job->errorString()); } - org::kde::KDirNotify::emitFilesAdded("trash:/"); + org::kde::KDirNotify::emitFilesAdded(QUrl("trash:/")); } void PlacesPanel::slotStorageSetupDone(int index, bool success) @@ -453,7 +462,7 @@ void PlacesPanel::emptyTrash() stream << int(1); KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs); KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent); - job->ui()->setWindow(parentWidget()); + KJobWidgets::setWindow(job, parentWidget()); connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*))); } }