]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placesitemmodel.cpp
Fix wrong window titles
[dolphin.git] / src / panels / places / placesitemmodel.cpp
index 86fbf886da4f30f5333bc58930d78d1ce9236ca3..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);
@@ -473,7 +476,8 @@ void PlacesItemModel::slotStorageTearDownDone(Solid::ErrorType error, const QVar
     if (error && errorData.isValid()) {
         emit errorMessage(errorData.toString());
     }
-    m_deviceToTearDown->disconnect();
+    disconnect(m_deviceToTearDown, &Solid::StorageAccess::teardownDone,
+               this, &PlacesItemModel::slotStorageTearDownDone);
     m_deviceToTearDown = nullptr;
 }