mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
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:
parent
2755391492
commit
2b700c5099
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue