]> git.sesse.net Git - kdenlive/blobdiff - src/clipmanager.cpp
normalize signal/slots
[kdenlive] / src / clipmanager.cpp
index 8eea860b1c9135bf09fbf2550b6119faba421e9c..8a1c36471de531e781068be4d04f82516205c378 100644 (file)
@@ -60,11 +60,11 @@ ClipManager::ClipManager(KdenliveDoc *doc) :
     m_clipIdCounter = 1;
     m_folderIdCounter = 1;
     m_modifiedTimer.setInterval(1500);
-    connect(&m_fileWatcher, SIGNAL(dirty(const QString &)), this, SLOT(slotClipModified(const QString &)));
-    connect(&m_fileWatcher, SIGNAL(deleted(const QString &)), this, SLOT(slotClipMissing(const QString &)));
+    connect(&m_fileWatcher, SIGNAL(dirty(QString)), this, SLOT(slotClipModified(QString)));
+    connect(&m_fileWatcher, SIGNAL(deleted(QString)), this, SLOT(slotClipMissing(QString)));
 
     // Seems like a dirty signal is emitted anyways when a watched file is created, so don't react twice.
-    //connect(&m_fileWatcher, SIGNAL(created(const QString &)), this, SLOT(slotClipAvailable(const QString &)));
+    //connect(&m_fileWatcher, SIGNAL(created(QString)), this, SLOT(slotClipAvailable(QString)));
     connect(&m_modifiedTimer, SIGNAL(timeout()), this, SLOT(slotProcessModifiedClips()));
 
 #if KDE_IS_VERSION(4,5,0)
@@ -123,7 +123,7 @@ void ClipManager::clearCache()
 #endif
 }
 
-void ClipManager::requestThumbs(const QString id, QList <int> frames)
+void ClipManager::slotRequestThumbs(const QString id, QList <int> frames)
 {
     m_thumbsMutex.lock();
     foreach (int frame, frames) {
@@ -264,12 +264,14 @@ void ClipManager::slotGetAudioThumbs()
         if (hash.isEmpty()) continue;
         QString audioPath = projectFolder() + "/thumbs/" + hash + ".thumb";
         double lengthInFrames = clip->duration().frames(m_doc->fps());
-       int frequency = 48000;
-       int channels = 2;
+       int frequency = 0;
+       int channels = 0;
        QString data = clip->getProperty("frequency");
        if (!data.isEmpty()) frequency = data.toInt();
+       if (frequency <= 0) frequency = 48000;
        data = clip->getProperty("channels");
        if (!data.isEmpty()) channels = data.toInt();
+       if (channels <= 0) channels = 2;
        int arrayWidth = 20;
         double frame = 0.0;
        int maxVolume = 0;
@@ -551,7 +553,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
                    copyjob->addMetaData("groupId", data.value("groupId"));
                    copyjob->addMetaData("comment", data.value("comment"));
                    copyjob->ui()->setWindow(kapp->activeWindow());
-                   connect(copyjob, SIGNAL(copyingDone(KIO::Job *, const KUrl &, const KUrl &, time_t, bool, bool)), this, SLOT(slotAddClip(KIO::Job *, const KUrl &, const KUrl &)));
+                   connect(copyjob, SIGNAL(copyingDone(KIO::Job*,KUrl,KUrl,time_t,bool,bool)), this, SLOT(slotAddClip(KIO::Job*,KUrl,KUrl)));
                    continue;
                }
            }
@@ -581,7 +583,12 @@ void ClipManager::slotAddClipList(const KUrl::List urls, QMap <QString, QString>
                     KFileMetaInfo metaInfo(file.path(), QString("image/jpeg"), KFileMetaInfo::TechnicalInfo);
                     const QHash<QString, KFileMetaInfoItem> metaInfoItems = metaInfo.items();
                     foreach(const KFileMetaInfoItem & metaInfoItem, metaInfoItems) {
-                        prod.setAttribute("meta.attr." + metaInfoItem.name().section('#', 1), metaInfoItem.value().toString());
+                       QDomElement meta = doc.createElement("metaproperty");
+                       meta.setAttribute("name", "meta.attr." + metaInfoItem.name().section('#', 1));
+                       QDomText value = doc.createTextNode(metaInfoItem.value().toString());
+                       meta.setAttribute("tool", "KDE Metadata");
+                       meta.appendChild(value);
+                       prod.appendChild(meta);
                     }
                 }
             } else if (type->is("application/x-kdenlivetitle")) {