]> git.sesse.net Git - vlc/commitdiff
qt4: remove b_is_node and use childCount() > 0 instead in playlist_model
authorIlkka Ollakka <ileoo@videolan.org>
Sun, 16 Aug 2009 12:21:18 +0000 (15:21 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Sun, 16 Aug 2009 12:21:26 +0000 (15:21 +0300)
modules/gui/qt4/components/playlist/playlist_item.cpp
modules/gui/qt4/components/playlist/playlist_item.hpp
modules/gui/qt4/components/playlist/playlist_model.cpp

index f1603288a625813f911241762c9ec59fdd1c4211..6c0c3a3f1010051b75c83abd0f67fd680ca24401 100644 (file)
@@ -54,7 +54,6 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent, PLModel *m,
     i_id       = _playlist_item->i_id;           /* Playlist item specific id */
     model      = m;               /* PLModel (QAbsmodel) */
     i_type     = -1;              /* Item type - Avoid segfault */
-    b_is_node  = _playlist_item->i_children > -1;
     p_input    = _playlist_item->p_input;
     vlc_gc_incref( p_input );
 
@@ -144,7 +143,6 @@ void PLItem::update( playlist_item_t *p_item )
 
     /* Useful for the model */
     i_type = p_item->p_input->i_type;
-    b_is_node = p_item->i_children > -1;
 
     i_showflags = parentItem ? parentItem->i_showflags : i_showflags;
 }
index c8cb2c65323ce56c9f2f20d645affc65ccff9bf9..c5734f37d56a17ddff248c29a5be19454ff3b333 100644 (file)
@@ -66,7 +66,6 @@ protected:
     int i_type;
     int i_id;
     int i_showflags;
-    bool b_is_node;
     input_item_t *p_input;
 
 private:
index 8b3606b4c58ce9ea9029931f0aa80b21b6b4c661..91a1c7e068b3b361954a1f5174716ab2ac7e2446 100644 (file)
@@ -146,7 +146,7 @@ Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
     }
     else
     {
-        if ( item->b_is_node &&
+        if ( (item->childCount() > 0) &&
             ( rootItem->p_input == pl_input ||
             rootItem->p_input == ml_input ) )
                 flags |= Qt::ItemIsDropEnabled;