]> git.sesse.net Git - kdenlive/blobdiff - src/projectsettings.cpp
Fix "Clean project" and "Delete unused files" removing folders and check for duplicat...
[kdenlive] / src / projectsettings.cpp
index ebd4bbc14b0bd29048203ea236a3af6e17749dbc..51d1bcd1f6c110a55b88611b685606952e0bdd12 100644 (file)
@@ -84,6 +84,16 @@ void ProjectSettings::slotDeleteUnused()
             if (!url.isEmpty()) toDelete << url.path();
         }
     }
+
+    // make sure our urls are not used in another clip
+    for (int i = 0; i < list.count(); i++) {
+        DocClipBase *clip = list.at(i);
+        if (clip->numReferences() > 0) {
+            KUrl url = clip->fileURL();
+            if (!url.isEmpty() && toDelete.contains(url.path())) toDelete.removeAll(url.path());
+        }
+    }
+
     if (toDelete.count() == 0) {
         KMessageBox::sorry(this, i18n("No clip to delete"));
         return;