]> git.sesse.net Git - vlc/commitdiff
Qt4 - Fix segfault from previous commit, and read from the config only once and simplify.
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 26 Jan 2008 06:24:47 +0000 (06:24 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 26 Jan 2008 06:24:47 +0000 (06:24 +0000)
modules/gui/qt4/components/playlist/playlist_item.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp

index 65e731ca7a65f807ad8e720a7c8d1601e29509ac..59221ad554e299803adbe822e1110de6cf1cb95b 100644 (file)
@@ -56,11 +56,18 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
 
     assert( model );              /* We need a model */
 
-    /* No parent, should be the main one */
+    /* No parent, should be the 2 main ones */
     if( parentItem == NULL )
     {
-        i_showflags = model->shownFlags();
-        updateColumnHeaders();
+        if( model->i_depth == DEPTH_SEL )  /* Selector Panel */
+        {
+            item_col_strings.append( "" );
+        }
+        else
+        {
+            i_showflags = config_GetInt( model->p_intf, "qt-pl-showflags" );
+            updateColumnHeaders();
+        }
     }
     else
     {
@@ -68,7 +75,6 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
         //Add empty string and update() handles data appending
         item_col_strings.append( "" );
     }
-    msg_Dbg( model->p_intf, "PLItem created of type: %i", model->i_depth );
 }
 
 /*
@@ -97,12 +103,6 @@ void PLItem::updateColumnHeaders()
 {
     item_col_strings.clear();
 
-    if( model->i_depth == DEPTH_SEL )  /* Selector Panel */
-    {
-        item_col_strings.append( "" );
-        return;
-    }
-
     for( int i_index=1; i_index <= VLC_META_ENGINE_ART_URL; i_index *= 2 )
     {
         if( i_showflags & i_index )
index dd6ca2c51017f578a881ea67e2e3816b587f404b..183aab9ad7a6ed3532648c6ad3129c7b94e7cdea 100644 (file)
@@ -114,7 +114,7 @@ public:
                       int row, int column, const QModelIndex &target );
     QStringList mimeTypes() const;
 
-    int shownFlags() {  return rootItem->i_showflags;  }
+    int shownFlags() { return rootItem->i_showflags;  }
 
 private:
     void addCallbacks();