From 844738fb918b5b5d1ae1a02884dc886dc9d63440 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 7 May 2013 15:31:11 +0530 Subject: 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 --- src/panels/places/placesitemmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index baf6be00e..eae2095c9 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/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); -- cgit v1.3