]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist_model.hpp
Qt4: cache currentItem index
[vlc] / modules / gui / qt4 / components / playlist / playlist_model.hpp
index 4db07d6b51bef83e27c63cef5e6cf417219a1cef..033cdc691ac1e576ee82d64c273d2b3c7e40bbe2 100644 (file)
@@ -47,6 +47,7 @@
 
 class PLItem;
 class PLSelector;
+class PlMimeData;
 
 class PLModel : public QAbstractItemModel
 {
@@ -141,9 +142,8 @@ private:
     void updateChildren( playlist_item_t *, PLItem * );
 
     /* Deep actions (affect core playlist) */
-    static void recursiveAppendCopy( playlist_t *, playlist_item_t *, playlist_item_t *, bool );
-    void dropAppendCopy( QByteArray& data, PLItem *target );
-    void dropMove( QByteArray& data, PLItem *target, int new_pos );
+    void dropAppendCopy( const PlMimeData * data, PLItem *target, int pos );
+    void dropMove( const PlMimeData * data, PLItem *target, int new_pos );
 
     /* Popup */
     int i_popup_item, i_popup_parent, i_popup_column;
@@ -161,6 +161,7 @@ private:
     PLItem *p_cached_item_bi;
     int i_cached_id;
     int i_cached_input_id;
+    QModelIndex current_index;
 
 private slots:
     void popupPlay();
@@ -175,6 +176,23 @@ private slots:
     void processInputItemUpdate( input_thread_t* p_input );
     void processItemRemoval( int i_id );
     void processItemAppend( int item, int parent );
+    void cacheCurrent( const QModelIndex & );
+};
+
+class PlMimeData : public QMimeData
+{
+    Q_OBJECT
+
+public:
+    PlMimeData();
+    ~PlMimeData();
+    void appendItem( input_item_t *p_item );
+    QList<input_item_t*> inputItems() const;
+    QStringList formats () const;
+
+private:
+    QList<input_item_t*> _inputItems;
+    QMimeData *_mimeData;
 };
 
 #endif