]> git.sesse.net Git - kdenlive/blobdiff - src/projectsettings.cpp
Merge branch 'master' of git://anongit.kde.org/kdenlive
[kdenlive] / src / projectsettings.cpp
index 2e33ae3f4297f75b910a92da6a00c03f0e051830..9289e18e0875a4099d61f08fae83573a104eb684 100644 (file)
@@ -255,6 +255,9 @@ void ProjectSettings::slotUpdateFiles(bool cacheOnly)
     QTreeWidgetItem *texts = new QTreeWidgetItem(files_list, QStringList() << i18n("Text clips"));
     texts->setIcon(0, KIcon("text-plain"));
     texts->setExpanded(true);
+    QTreeWidgetItem *playlists = new QTreeWidgetItem(files_list, QStringList() << i18n("Playlist clips"));
+    playlists->setIcon(0, KIcon("video-mlt-playlist"));
+    playlists->setExpanded(true);
     QTreeWidgetItem *others = new QTreeWidgetItem(files_list, QStringList() << i18n("Other clips"));
     others->setIcon(0, KIcon("unknown"));
     others->setExpanded(true);
@@ -285,6 +288,9 @@ void ProjectSettings::slotUpdateFiles(bool cacheOnly)
             case IMAGE:
                 new QTreeWidgetItem(images, QStringList() << clip->fileURL().path());
                 break;
+            case PLAYLIST:
+                new QTreeWidgetItem(playlists, QStringList() << clip->fileURL().path());
+                break;
             case UNKNOWN:
                 new QTreeWidgetItem(others, QStringList() << clip->fileURL().path());
                 break;
@@ -458,6 +464,9 @@ QStringList ProjectSettings::extractPlaylistUrls(QString path)
         QString type = EffectsList::property(e, "mlt_service");
         if (type != "colour") {
             QString url = EffectsList::property(e, "resource");
+            if (type == "framebuffer") {
+                url = url.section('?', 0, 0);
+            }
             if (!url.isEmpty()) {
                 if (!url.startsWith('/')) url.prepend(root);
                 if (url.section('.', 0, -2).endsWith("/.all")) {
@@ -500,20 +509,20 @@ QStringList ProjectSettings::extractSlideshowUrls(KUrl url)
         filters << "*." + ext;
         dir.setNameFilters(filters);
         QStringList result = dir.entryList(QDir::Files);
-        urls.append(path + filters.at(0) + " (" + i18np("1 image found", "%1 images found", result.count()) + ")");
+        urls.append(path + filters.at(0) + " (" + i18np("1 image found", "%1 images found", result.count()) + ')');
     } else {
         // this is a pattern slideshow, like sequence%4d.jpg
         QString filter = url.fileName();
         QString ext = filter.section('.', -1);
         filter = filter.section('%', 0, -2);
-        QString regexp = "^" + filter + "\\d+\\." + ext + "$";
+        QString regexp = '^' + filter + "\\d+\\." + ext + '$';
         QRegExp rx(regexp);
         int count = 0;
         QStringList result = dir.entryList(QDir::Files);
         foreach(const QString & path, result) {
             if (rx.exactMatch(path)) count++;
         }
-        urls.append(url.path() + " (" + i18np("1 image found", "%1 images found", count) + ")");
+        urls.append(url.path() + " (" + i18np("1 image found", "%1 images found", count) + ')');
     }
     return urls;
 }
@@ -523,14 +532,14 @@ void ProjectSettings::slotExportToText()
     QString savePath = KFileDialog::getSaveFileName(project_folder->url(), "text/plain", this);
     if (savePath.isEmpty()) return;
     QString data;
-    data.append(i18n("Project folder: %1",  project_folder->url().path()) + "\n");
-    data.append(i18n("Project profile: %1",  profiles_list->currentText()) + "\n");
+    data.append(i18n("Project folder: %1",  project_folder->url().path()) + '\n');
+    data.append(i18n("Project profile: %1",  profiles_list->currentText()) + '\n');
     data.append(i18n("Total clips: %1 (%2 used in timeline).", files_count->text(), used_count->text()) + "\n\n");
     for (int i = 0; i < files_list->topLevelItemCount(); i++) {
         if (files_list->topLevelItem(i)->childCount() > 0) {
-            data.append("\n" + files_list->topLevelItem(i)->text(0) + ":\n\n");
+            data.append('\n' + files_list->topLevelItem(i)->text(0) + ":\n\n");
             for (int j = 0; j < files_list->topLevelItem(i)->childCount(); j++) {
-                data.append(files_list->topLevelItem(i)->child(j)->text(0) + "\n");
+                data.append(files_list->topLevelItem(i)->child(j)->text(0) + '\n');
             }
         }
     }
@@ -540,7 +549,8 @@ void ProjectSettings::slotExportToText()
         return;
     }
     QFile xmlf(tmpfile.fileName());
-    xmlf.open(QIODevice::WriteOnly);
+    if (!xmlf.open(QIODevice::WriteOnly))
+        return;
     xmlf.write(data.toUtf8());
     if (xmlf.error() != QFile::NoError) {
         xmlf.close();