]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placesitemmodel.cpp
[InformationPanel] Hide the video when the preview is disabled, avoid computing the...
[dolphin.git] / src / panels / places / placesitemmodel.cpp
index 7513a25d522309db65de2a823f7777a3f386012a..e8636942b83ac645e7309a9808379ae448ca1cf6 100644 (file)
@@ -353,7 +353,10 @@ void PlacesItemModel::dropMimeDataBefore(int index, const QMimeData* mimeData)
         int oldIndex;
         stream >> oldIndex;
 
-        m_sourceModel->movePlace(oldIndex, index);
+        QModelIndex sourceIndex = mapToSource(index);
+        QModelIndex oldSourceIndex = mapToSource(oldIndex);
+
+        m_sourceModel->movePlace(oldSourceIndex.row(), sourceIndex.row());
     } else if (mimeData->hasFormat(QStringLiteral("text/uri-list"))) {
         // One or more items must be added to the model
         const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);