]> git.sesse.net Git - kdenlive/blobdiff - src/clipmanager.h
Warn user when adding a clip from a removable drive, and propose to copy clip to...
[kdenlive] / src / clipmanager.h
index ce5089278a6a8f91e2d39be969988c137ca945aa..624bb9b5dda1969cfe6164fcb5339193ffe2c57b 100644 (file)
@@ -38,6 +38,7 @@
 #include <KDirWatch>
 #include <klocale.h>
 #include <kdeversion.h>
+#include <KIO/CopyJob>
 
 #if KDE_IS_VERSION(4,5,0)
 #include <KImageCache>
@@ -52,6 +53,21 @@ class KdenliveDoc;
 class DocClipBase;
 class AbstractGroupItem;
 
+
+class SolidVolumeInfo
+{
+
+public:
+
+    QString path; // mount path of volume, with trailing slash
+    QString uuid; // UUID as from Solid
+    QString label; // volume label (think of CDs)
+    bool isRemovable; // may be removed
+    bool isMounted;
+
+    bool isNull() const { return path.isNull(); }
+};
+
 namespace Mlt
 {
 class Producer;
@@ -125,6 +141,8 @@ private slots:
     void slotProcessModifiedClips();
     void slotGetThumbs();
     void slotGetAudioThumbs();
+    /** @brief Clip has been copied, add it now. */
+    void slotAddClip(KIO::Job *job, const KUrl &, const KUrl &dst);
 
 private:   // Private attributes
     /** the list of clips in the document */
@@ -157,6 +175,13 @@ private:   // Private attributes
     bool m_abortAudioThumb;
     /** @brief The id of currently processed clip for audio thumbs creation. */
     QString m_processingAudioThumbId;
+    /** @brief The list of removable drives. */
+    QList<SolidVolumeInfo> m_removableVolumes;
+    
+    /** @brief Get a list of drives, to check if we have files on removable media. */
+    void listRemovableVolumes();
+    /** @brief Check if added file is on a removable drive. */
+    bool isOnRemovableDevice(const KUrl &url);
 
 signals:
     void reloadClip(const QString &);