[vlc-devel] commit: Qt: ID column in playlist sucked. Also, don't show ID by default. ( Jean-Philippe Andre )

git version control git at videolan.org
Sun Aug 24 20:01:46 CEST 2008


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Sun Aug 24 13:50:43 2008 -0400| [733a8325ef811c5416864825d1f149ef1d542f91] | committer: Jean-Philippe Andre 

Qt: ID column in playlist sucked. Also, don't show ID by default.
Note: this is still buggy as deletng items does not update other item's IDs

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

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

diff --git a/modules/gui/qt4/components/playlist/playlist_item.cpp b/modules/gui/qt4/components/playlist/playlist_item.cpp
index a64cb16..9020a7c 100644
--- a/modules/gui/qt4/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_item.cpp
@@ -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 )
         {




More information about the vlc-devel mailing list