]> git.sesse.net Git - kdenlive/commitdiff
Fix loading of project folders
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Oct 2008 10:09:44 +0000 (10:09 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Oct 2008 10:09:44 +0000 (10:09 +0000)
svn path=/branches/KDE4/; revision=2457

src/projectlist.cpp

index 4b2c345be8335ddb7132b702f27de5067e3d9c1d..617ae1ae78efbc1e38c1f5e77fc6e644092fc309 100644 (file)
@@ -285,10 +285,19 @@ void ProjectList::slotAddFolder(const QString foldername, const QString &clipId,
 }
 
 void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) {
-    const QString parent = clip->toXML().attribute("groupid");
+    const QString parent = clip->getProperty("groupid");
     ProjectItem *item = NULL;
-    if (parent != 0) {
+    if (!parent.isEmpty()) {
         ProjectItem *parentitem = getItemById(parent);
+        if (!parentitem) {
+            QStringList text;
+            QString groupName = clip->getProperty("groupname");
+            if (groupName.isEmpty()) groupName = i18n("Folder");
+            text << QString() << groupName;
+            listView->blockSignals(true);
+            parentitem = new ProjectItem(listView, text, parent);
+            listView->blockSignals(false);
+        }
         if (parentitem) item = new ProjectItem(parentitem, clip);
     }
     if (item == NULL) item = new ProjectItem(listView, clip);