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
This commit is contained in:
Vishesh Handa 2013-05-07 15:37:27 +05:30
parent c756bc6c89
commit c69ebd1e0c

View file

@ -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(),