From 2b700c509981721465b10a41a2e3a0fbd6680ae2 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 7 May 2013 15:31:11 +0530 Subject: [PATCH] PlacesModel: Only allow folders to be pinned It makes no sense to pin files. Plus the old PlacesModel from kdelibs had the same behaviour. REVIEW: 110347 --- dolphin/src/panels/places/placesitemmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dolphin/src/panels/places/placesitemmodel.cpp b/dolphin/src/panels/places/placesitemmodel.cpp index baf6be00e6..eae2095c99 100644 --- a/dolphin/src/panels/places/placesitemmodel.cpp +++ b/dolphin/src/panels/places/placesitemmodel.cpp @@ -444,6 +444,11 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData) text = url.host(); } + if (url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir()) { + // Only directories are allowed + continue; + } + PlacesItem* newItem = createPlacesItem(text, url); const int dropIndex = groupedDropIndex(index, newItem); insertItem(dropIndex, newItem);