]> cloud.milkyroute.net Git - dolphin.git/commitdiff
PlacesModel: Only allow folders to be pinned
authorVishesh Handa <me@vhanda.in>
Tue, 7 May 2013 10:01:11 +0000 (15:31 +0530)
committerVishesh Handa <me@vhanda.in>
Tue, 28 May 2013 16:22:01 +0000 (21:52 +0530)
It makes no sense to pin files. Plus the old
PlacesModel from kdelibs had the same behaviour.

REVIEW: 110347

src/panels/places/placesitemmodel.cpp

index baf6be00e6deb21a9661f3426fea680a52c5c9a5..eae2095c994ff37fe78fb8dc9a82a1be2cdda644 100644 (file)
@@ -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);