diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 02e1944bd..1138f1378 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -370,6 +370,10 @@ void PlacesItemModel::dropMimeData(int index, const QMimeData* mimeData) QDataStream stream(&itemData, QIODevice::ReadOnly); int oldIndex; stream >> oldIndex; + if (oldIndex == index || oldIndex == index - 1) { + // No moving has been done + return; + } PlacesItem* oldItem = placesItem(oldIndex); if (!oldItem) { @@ -379,7 +383,7 @@ void PlacesItemModel::dropMimeData(int index, const QMimeData* mimeData) PlacesItem* newItem = new PlacesItem(oldItem->bookmark()); removeItem(oldIndex); - if (oldIndex <= index) { + if (oldIndex < index) { --index; } |
