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
This commit is contained in:
Vishesh Handa 2013-05-07 15:31:11 +05:30
parent 2755391492
commit 2b700c5099

View file

@ -444,6 +444,11 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
text = url.host(); text = url.host();
} }
if (url.isLocalFile() && !QFileInfo(url.toLocalFile()).isDir()) {
// Only directories are allowed
continue;
}
PlacesItem* newItem = createPlacesItem(text, url); PlacesItem* newItem = createPlacesItem(text, url);
const int dropIndex = groupedDropIndex(index, newItem); const int dropIndex = groupedDropIndex(index, newItem);
insertItem(dropIndex, newItem); insertItem(dropIndex, newItem);