diff options
| author | Vishesh Handa <[email protected]> | 2013-05-07 15:31:11 +0530 |
|---|---|---|
| committer | Vishesh Handa <[email protected]> | 2013-05-28 21:52:01 +0530 |
| commit | 844738fb918b5b5d1ae1a02884dc886dc9d63440 (patch) | |
| tree | aa74ae6a4d7914f8884a0bb6bd56f05247cabbd3 | |
| parent | c69ebd1e0c5ae1803f2e7e01d433168aba57115f (diff) | |
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
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |
