]> cloud.milkyroute.net Git - dolphin.git/commitdiff
PlacesPanel: Do not allow drop events into timeline or search folder
authorVishesh Handa <me@vhanda.in>
Tue, 7 May 2013 10:07:27 +0000 (15:37 +0530)
committerVishesh Handa <me@vhanda.in>
Tue, 28 May 2013 15:51:27 +0000 (21:21 +0530)
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

index 0f5b83ad5fdca2193da412de31c02c05dcc6c273..d5308eabe1ccf366978d00a2b800cd9f5be60199 100644 (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(),