From: Vishesh Handa Date: Tue, 7 May 2013 10:07:27 +0000 (+0530) Subject: PlacesPanel: Do not allow drop events into timeline or search folder X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c69ebd1e0c5ae1803f2e7e01d433168aba57115f?ds=sidebyside PlacesPanel: Do not allow drop events into timeline or search folder They are read only. You cannot modify them, so it makes no point showing the "Move/Copy Into" context menu. REVIEW: 110348 --- diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 0f5b83ad5..d5308eabe 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -332,6 +332,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 +362,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(),