]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.cpp
Progress on stopmotion widget (make it possible to switch between HDMI and V4L)
[kdenlive] / src / projectlist.cpp
index b41fc50e8d33f926283d8749aa4aaaeb597c6d7c..66cf7d752b6e7960c7f0f0bd12543d918ea7f879 100644 (file)
@@ -1104,9 +1104,10 @@ void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &group
             if (fileName.at(fileName.size() - 1).isDigit()) {
                 KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
                 if (item.mimetype().startsWith("image")) {
-                    int count = 0;
                     // import as sequence if we found more than one image in the sequence
-                    QString pattern = SlideshowClip::selectedPath(url.path(), false, QString(), &count);
+                    QStringList list;
+                    QString pattern = SlideshowClip::selectedPath(url.path(), false, QString(), &list);
+                    int count = list.count();
                     if (count > 1) {
                         delete d;
                         QStringList groupInfo = getGroup();
@@ -1841,33 +1842,32 @@ void ProjectList::slotForceProcessing(const QString &id)
 void ProjectList::slotAddOrUpdateSequence(const QString frameName)
 {
     QString fileName = KUrl(frameName).fileName().section('_', 0, -2);
-    int count;
-    QString pattern = SlideshowClip::selectedPath(frameName, false, QString(), &count);
+    QStringList list;
+    QString pattern = SlideshowClip::selectedPath(frameName, false, QString(), &list);
+    int count = list.count();
     if (count > 1) {
-         const QList <DocClipBase *> existing = m_doc->clipManager()->getClipByResource(pattern);
-       if (!existing.isEmpty()) {
-           // Sequence already exists, update
-           QString id = existing.at(0)->getId();
-           //ProjectItem *item = getItemById(id);
+        const QList <DocClipBase *> existing = m_doc->clipManager()->getClipByResource(pattern);
+        if (!existing.isEmpty()) {
+            // Sequence already exists, update
+            QString id = existing.at(0)->getId();
+            //ProjectItem *item = getItemById(id);
             QMap <QString, QString> oldprops;
             QMap <QString, QString> newprops;
-           int ttl = existing.at(0)->getProperty("ttl").toInt();
+            int ttl = existing.at(0)->getProperty("ttl").toInt();
             oldprops["out"] = existing.at(0)->getProperty("out");
             newprops["out"] = QString::number(ttl * count - 1);
-           slotUpdateClipProperties(id, newprops);
+            slotUpdateClipProperties(id, newprops);
             EditClipCommand *command = new EditClipCommand(this, id, oldprops, newprops, false);
             m_commandStack->push(command);
-       }
-       else {
-           // Create sequence
-           QStringList groupInfo = getGroup();
-           m_doc->slotCreateSlideshowClipFile(fileName, pattern, count, m_timecode.reformatSeparators(KdenliveSettings::sequence_duration()),
-                                                           false, false, false,
-                                                           m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))), QString(), 0,
-                                                           QString(), groupInfo.at(0), groupInfo.at(1));
-       }
-    }
-    else emit displayMessage(i18n("Sequence not found"), -2);
+        } else {
+            // Create sequence
+            QStringList groupInfo = getGroup();
+            m_doc->slotCreateSlideshowClipFile(fileName, pattern, count, m_timecode.reformatSeparators(KdenliveSettings::sequence_duration()),
+                                               false, false, false,
+                                               m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))), QString(), 0,
+                                               QString(), groupInfo.at(0), groupInfo.at(1));
+        }
+    } else emit displayMessage(i18n("Sequence not found"), -2);
 }
 
 #include "projectlist.moc"