From c69ebd1e0c5ae1803f2e7e01d433168aba57115f Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 7 May 2013 15:37:27 +0530 Subject: [PATCH] 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 --- src/panels/places/placespanel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(), -- 2.47.3