[vlc-commits] Qt: PLItem: add playlist flags

Francois Cartegnie git at videolan.org
Tue May 10 19:30:36 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 10 17:47:09 2016 +0200| [3a3af320744879507f8b2ce1a52694129c16107b] | committer: Francois Cartegnie

Qt: PLItem: add playlist flags

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3a3af320744879507f8b2ce1a52694129c16107b
---

 modules/gui/qt/components/playlist/playlist_item.cpp |    6 ++++++
 modules/gui/qt/components/playlist/playlist_item.hpp |    3 +++
 2 files changed, 9 insertions(+)

diff --git a/modules/gui/qt/components/playlist/playlist_item.cpp b/modules/gui/qt/components/playlist/playlist_item.cpp
index 9843e93..08e78f3 100644
--- a/modules/gui/qt/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt/components/playlist/playlist_item.cpp
@@ -60,6 +60,7 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent )
     parentItem = parent;          /* Can be NULL, but only for the rootItem */
     i_playlist_id = _playlist_item->i_id;           /* Playlist item specific id */
     p_input = _playlist_item->p_input;
+    i_flags = _playlist_item->i_flags;
     vlc_gc_incref( p_input );
 }
 
@@ -156,3 +157,8 @@ QString PLItem::getTitle() const
     free(fb_name);
     return title;
 }
+
+bool PLItem::readOnly() const
+{
+    return i_flags & PLAYLIST_RO_FLAG;
+}
diff --git a/modules/gui/qt/components/playlist/playlist_item.hpp b/modules/gui/qt/components/playlist/playlist_item.hpp
index 0a40871..599fd84 100644
--- a/modules/gui/qt/components/playlist/playlist_item.hpp
+++ b/modules/gui/qt/components/playlist/playlist_item.hpp
@@ -64,6 +64,7 @@ protected:
     void clearChildren();
     virtual QUrl getURI() const = 0;
     virtual QString getTitle() const = 0;
+    virtual bool readOnly() const = 0;
 
     QList<AbstractPLItem *> children;
     AbstractPLItem *parentItem;
@@ -85,6 +86,7 @@ private:
     AbstractPLItem *child( int id ) const { return children.value( id ); };
     virtual QUrl getURI() const;
     virtual QString getTitle() const;
+    virtual bool readOnly() const;
 
     /* Local */
     PLItem( playlist_item_t *, PLItem *parent );
@@ -94,6 +96,7 @@ private:
     PLItem( playlist_item_t * );
     void init( playlist_item_t *, PLItem * );
     int i_playlist_id;
+    int i_flags;
     input_item_t *p_input;
 };
 



More information about the vlc-commits mailing list