From: Vishesh Handa Date: Tue, 7 May 2013 10:01:11 +0000 (+0530) Subject: PlacesModel: Only allow folders to be pinned X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/844738fb918b5b5d1ae1a02884dc886dc9d63440?ds=inline 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 --- 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);