]> git.sesse.net Git - kdenlive/blobdiff - src/slideshowclip.cpp
Also show kdenlive lumas in the slideshow dialog
[kdenlive] / src / slideshowclip.cpp
index 29d84b2ae441b902eab6193dbe5f5edd5a8a7cf9..55f63fd14f5f4cb0e9b662711d7b811c97856090 100644 (file)
@@ -53,18 +53,26 @@ SlideshowClip::SlideshowClip(QWidget * parent): QDialog(parent), m_count(0) {
     m_view.folder_url->setUrl(QDir::homePath());
 
 
+    // Check for Kdenlive installed luma files
+    QStringList filters;
+    filters << "*.pgm" << "*.png";
+
+    QStringList customLumas = KGlobal::dirs()->findDirs("appdata", "lumas");
+    foreach(const QString &folder, customLumas) {
+        QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
+        foreach(const QString &fname, filesnames) {
+            m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
+        }
+    }
+
+    // Check for MLT lumas
     QString profilePath = KdenliveSettings::mltpath();
-    profilePath = profilePath.section('/', 0, -3);
-    profilePath += "/lumas/PAL/";
-
-    QDir dir(profilePath);
-    QStringList filter;
-    filter << "*.pgm";
-    const QStringList result = dir.entryList(filter, QDir::Files);
-    QStringList imagefiles;
-    QStringList imagenamelist;
-    foreach(const QString file, result) {
-        m_view.luma_file->addItem(KIcon(profilePath + file), file, profilePath + file);
+    QString folder = profilePath.section('/', 0, -3);
+    folder.append("/lumas/PAL"); // TODO: cleanup the PAL / NTSC mess in luma files
+    QDir lumafolder(folder);
+    QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
+    foreach(const QString &fname, filesnames) {
+        m_view.luma_file->addItem(KIcon(folder + '/' + fname), fname, folder + '/' + fname);
     }
 
     adjustSize();