diff options
| author | Peter Penz <[email protected]> | 2012-06-02 15:53:16 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-06-02 15:53:50 +0200 |
| commit | 5269938f24cf5244047e39a8bd600187b14b076a (patch) | |
| tree | e65ef4a316f661375167d32b292aa14ce88d5861 | |
| parent | a2674f5184c1c6fbcf1f8bbb8099761888f5880d (diff) | |
Don't remove/insert an item if no moving has been done at all
| -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; } |
