]> git.sesse.net Git - kdenlive/commitdiff
Fix crash when dropping folder in project tree:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 19 Nov 2009 19:56:54 +0000 (19:56 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 19 Nov 2009 19:56:54 +0000 (19:56 +0000)
http://kdenlive.org/mantis/view.php?id=1287

svn path=/trunk/kdenlive/; revision=4139

src/projectlist.cpp

index 9a2d514b552bd10c60203df22d3855d598518349..f150cb9961e273dca5d07979cbff8f215f16f026 100644 (file)
@@ -802,6 +802,16 @@ void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &group
         for (int i = 0; i < givenList.count(); i++)
             list << givenList.at(i);
     }
+    
+    foreach(const KUrl &file, list) {
+       // Check there is no folder here
+       KMimeType::Ptr type = KMimeType::findByUrl(file);
+       if (type->is("inode/directory")) {
+           // user dropped a folder
+           list.removeAll(file);
+       }
+    }
+    
     if (list.isEmpty()) return;
 
     if (givenList.isEmpty()) {