]> git.sesse.net Git - kdenlive/blobdiff - src/clipproperties.cpp
Allow loading and saving of only one category of markers
[kdenlive] / src / clipproperties.cpp
index 3fd5b351e4eca050e6bd5e3905f7879f5db89e31..991666340ad4d06ca4433574d84a162694cb3952 100644 (file)
@@ -773,11 +773,16 @@ void ClipProperties::slotEditMarker()
 void ClipProperties::slotDeleteMarker()
 {
     QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
-    int pos = m_view.markers_list->currentIndex().row();
-    if (pos < 0 || pos > marks.count() - 1) return;
-    CommentedTime marker = marks.at(pos);
-    marker.setMarkerType(-1);
-    emit addMarker(m_clip->getId(), marker);
+    QList < CommentedTime > toDelete;
+    for (int i = 0; i < marks.count(); i++) {
+       if (m_view.markers_list->topLevelItem(i)->isSelected()) {
+           CommentedTime marker = marks.at(i);
+           marker.setMarkerType(-1);
+           toDelete << marker;
+       }
+    }
+    for (int i = 0; i < toDelete.count(); i++)
+       emit addMarker(m_clip->getId(), toDelete.at(i));
 }
 
 const QString &ClipProperties::clipId() const