]> git.sesse.net Git - kdenlive/blobdiff - src/clipproperties.cpp
Add center-crop option to slideshow clip.
[kdenlive] / src / clipproperties.cpp
index 571343061cede51a51a4adbffc3c8f4c64c28d1a..4ff65f02550b139de7a2e216473f53fc2c07c5a6 100644 (file)
@@ -185,6 +185,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
         m_view.image_type->addItem("Open EXR (*.exr)", "exr");
 
         m_view.slide_loop->setChecked(props.value("loop").toInt());
+        m_view.slide_crop->setChecked(props.value("crop").toInt());
         m_view.slide_fade->setChecked(props.value("fade").toInt());
         m_view.luma_softness->setValue(props.value("softness").toInt());
         QString path = props.value("resource");
@@ -575,18 +576,23 @@ QMap <QString, QString> ClipProperties::properties()
     } else if (t == SLIDESHOW) {
         QString value = QString::number((int) m_view.slide_loop->isChecked());
         if (m_old_props.value("loop") != value) props["loop"] = value;
+        value = QString::number((int) m_view.slide_crop->isChecked());
+        if (m_old_props.value("crop") != value) props["crop"] = value;
         value = QString::number((int) m_view.slide_fade->isChecked());
         if (m_old_props.value("fade") != value) props["fade"] = value;
         value = QString::number((int) m_view.luma_softness->value());
         if (m_old_props.value("softness") != value) props["softness"] = value;
-
-        QString extension = "/.all." + m_view.image_type->itemData(m_view.image_type->currentIndex()).toString();
-        QString new_path = m_view.clip_path->text() + extension;
-        if (new_path != m_old_props.value("resource")) {
-            m_clipNeedsReLoad = true;
-            props["resource"] = new_path;
-            kDebug() << "////  SLIDE EDIT, NEW:" << new_path << ", OLD; " << m_old_props.value("resource");
-        }
+       
+       bool isMime = !(m_view.clip_path->text().contains('%'));
+       if (isMime) {
+           QString extension = "/.all." + m_view.image_type->itemData(m_view.image_type->currentIndex()).toString();
+           QString new_path = m_view.clip_path->text() + extension;
+           if (new_path != m_old_props.value("resource")) {
+               m_clipNeedsReLoad = true;
+               props["resource"] = new_path;
+               kDebug() << "////  SLIDE EDIT, NEW:" << new_path << ", OLD; " << m_old_props.value("resource");
+           }
+       }
         int duration;
         if (m_view.slide_duration_format->currentIndex() == 1) {
             // we are in frames mode
@@ -643,7 +649,7 @@ bool ClipProperties::needsTimelineReload() const
 void ClipProperties::parseFolder()
 {
     QString path = m_view.clip_path->text();
-    bool isMime = !(path.contains("%d"));
+    bool isMime = !(path.contains('%'));
     if (!isMime) path = KUrl(path).directory();
     QDir dir(path);
 
@@ -663,8 +669,8 @@ void ClipProperties::parseFolder()
         // find pattern
         QString filter = KUrl(m_view.clip_path->text()).fileName();
         QString ext = filter.section('.', -1);
-        filter = filter.section("%d", 0, -2);
-        QString regexp = "^" + filter + "\\d+\." + ext + "$";
+        filter = filter.section('%', 0, -2);
+        QString regexp = "^" + filter + "\\d+\\." + ext + "$";
         QRegExp rx(regexp);
         QStringList entries;
         foreach(const QString &path, result) {