]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist_item.cpp
Last patch to close #1479 (add a column with the track id)
[vlc] / modules / gui / qt4 / components / playlist / playlist_item.cpp
index 3d52abd8f9fea2a2cef95836bb7fcb023d448566..32aa4a7e4b01299b6f65b7149f6e80cfb98537c1 100644 (file)
@@ -34,6 +34,8 @@
 
 #include "pixmaps/type_unknown.xpm"
 
+#include <QSettings>
+
 /*************************************************************************
  * Playlist item implementation
  *************************************************************************/
@@ -67,7 +69,9 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
         else
         {
             QSettings settings( "vlc", "vlc-qt-interface" );
-            i_showflags = settings.value( "qt-pl-showflags" ).toInt();
+            i_showflags = settings.value( "qt-pl-showflags", 39 ).toInt();
+            if( i_showflags < 1)
+                i_showflags = 39; //reasonable default to show something;
             updateColumnHeaders();
         }
     }
@@ -135,6 +139,9 @@ void PLItem::updateColumnHeaders()
             case VLC_META_ENGINE_RATING:
                 item_col_strings.append( qtr( VLC_META_RATING ) );
                 break;
+            case VLC_META_ENGINE_TRACKID:
+                item_col_strings.append( qtr( VLC_META_TRACKID ) );
+                break;
             default:
                 break;
             }
@@ -253,6 +260,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
                 break;
             case VLC_META_ENGINE_RATING:
                 ADD_META( p_item, Rating );
+                break;
+            case VLC_META_ENGINE_TRACKID:
+                item_col_strings.append( QString::number( p_item->i_id ) );
+                break;
             default:
                 break;
             }