]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist_model.cpp
Add URI column to Qt4 playlist. Add sorting by URI in playlist core.
[vlc] / modules / gui / qt4 / components / playlist / playlist_model.cpp
index 8edada7dcc01c31b6270883b8264e07fc5dff47e..6d3a7ef77eb50615a08e98a90bfa3e5aea4cbe3d 100644 (file)
@@ -745,27 +745,18 @@ void PLModel::sort( int column, Qt::SortOrder order )
         return;
     }
 
-#define CHECK_COLUMN( meta )                        \
-{                                                   \
-    if( ( shownFlags() & meta ) )                   \
-        i_index++;                                  \
-    if( column == i_index )                         \
-    {                                               \
-        i_flag = meta;                              \
-        goto next;                                  \
-    }                                               \
-}
-
-    CHECK_COLUMN( COLUMN_NUMBER );
-    CHECK_COLUMN( COLUMN_TITLE );
-    CHECK_COLUMN( COLUMN_DURATION );
-    CHECK_COLUMN( COLUMN_ARTIST );
-    CHECK_COLUMN( COLUMN_GENRE );
-    CHECK_COLUMN( COLUMN_ALBUM );
-    CHECK_COLUMN( COLUMN_TRACK_NUMBER );
-    CHECK_COLUMN( COLUMN_DESCRIPTION );
-
-#undef CHECK_COLUMN
+    int i_column = 1;
+    for( i_column = 1; i_column != COLUMN_END; i_column<<=1 )
+    {
+        if( ( shownFlags() & i_column ) )
+            i_index++;
+        if( column == i_index )
+        {
+            i_flag = i_column;
+            goto next;
+        }
+    }
+
 
 next:
     PL_LOCK;