[vlc-devel] commit: Qt4: items showflags, parentItem can be NULL (Ilkka Ollakka )

git version control git at videolan.org
Sun Sep 21 20:49:22 CEST 2008


vlc | branch: 0.9-bugfix | Ilkka Ollakka <ileoo at videolan.org> | Sun Sep 21 14:43:21 2008 +0300| [4f0f2c2cd7a21b0f5bd5f52e093cc8e42067f0e1] | committer: Jean-Baptiste Kempf 

Qt4: items showflags, parentItem can be NULL

Qt4: playlist Item MUST inherit from their parent the show flags on update.

(cherry picked from commit ad87b9243e4314f6cef58362cfddb525db35de6e)
(cherry picked from commit 3519bb1d530743f6d94839e005e3c65ca046df64)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 .../gui/qt4/components/playlist/playlist_item.cpp  |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_item.cpp b/modules/gui/qt4/components/playlist/playlist_item.cpp
index 46f1cf5..71f3fd0 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.cpp
@@ -64,6 +64,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m, QSett
     {
         if( model->i_depth == DEPTH_SEL )  /* Selector Panel */
         {
+            i_showflags = 0;
             item_col_strings.append( "" );
         }
         else
@@ -185,10 +186,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
         return;
     }
 
-    assert( parentItem->i_showflags < COLUMN_END );
+    i_showflags = parentItem ? parentItem->i_showflags : i_showflags;
 
     /* Meta: ID */
-    if( parentItem->i_showflags & COLUMN_NUMBER )
+    if( i_showflags & COLUMN_NUMBER )
     {
         QModelIndex idx = model->index( this, 0 );
         item_col_strings.append( QString::number( idx.row() + 1 ) );
@@ -196,7 +197,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
     /* Other meta informations */
     for( uint32_t i_index=2; i_index < COLUMN_END; i_index <<= 1 )
     {
-        if( parentItem->i_showflags & i_index )
+        if( i_showflags & i_index )
         {
             char *psz = psz_column_meta( p_item->p_input, i_index );
             item_col_strings.append( qfu( psz ) );
@@ -204,3 +205,4 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
         }
     }
 }
+




More information about the vlc-devel mailing list