]> git.sesse.net Git - vlc/commitdiff
Qt: ID column in playlist sucked. Also, don't show ID by default.
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Sun, 24 Aug 2008 17:50:43 +0000 (13:50 -0400)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Sun, 24 Aug 2008 18:04:04 +0000 (14:04 -0400)
Note: this is still buggy as deletng items does not update other item's IDs

modules/gui/qt4/components/playlist/playlist_item.cpp

index a64cb166704e96d7c45040a1618adc60903fce07..9020a7cc32e09e69f3d4bb3d0ec1084c05906009 100644 (file)
@@ -68,9 +68,9 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m, QSett
         }
         else
         {
-            i_showflags = settings->value( "qt-pl-showflags", 39 ).toInt();
+            i_showflags = settings->value( "qt-pl-showflags", 38 ).toInt();
             if( i_showflags < 1)
-                i_showflags = 39; /* reasonable default to show something; */
+                i_showflags = 38; /* reasonable default to show something; */
             else if ( i_showflags >= COLUMN_END )
                 i_showflags = COLUMN_END - 1; /* show everything */
 
@@ -187,7 +187,14 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
 
     assert( parentItem->i_showflags < COLUMN_END );
 
-    for( uint32_t i_index=1; i_index < COLUMN_END; i_index <<= 1 )
+    /* Meta: ID */
+    if( parentItem->i_showflags & COLUMN_NUMBER )
+    {
+        QModelIndex idx = model->index( this, 0 );
+        item_col_strings.append( QString::number( idx.row() + 1 ) );
+    }
+    /* Other meta informations */
+    for( uint32_t i_index=2; i_index < COLUMN_END; i_index <<= 1 )
     {
         if( parentItem->i_showflags & i_index )
         {