vlc | branch: master | Wieland Hoffmann <[email protected]> | Mon Feb 29 15:04:16 2016 +0100| [74271ffce8c57b7365b6bdda0123f6ea209d208e] | committer: Jean-Baptiste Kempf
Qt: Allow sorting by disc number Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=74271ffce8c57b7365b6bdda0123f6ea209d208e --- modules/gui/qt/components/playlist/sorting.h | 8 +++++++- modules/gui/qt/components/playlist/standardpanel.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt/components/playlist/sorting.h b/modules/gui/qt/components/playlist/sorting.h index 13a6905..fe0a615 100644 --- a/modules/gui/qt/components/playlist/sorting.h +++ b/modules/gui/qt/components/playlist/sorting.h @@ -41,10 +41,11 @@ enum COLUMN_NUMBER = 0x0100, COLUMN_RATING = 0x0200, COLUMN_COVER = 0x0400, + COLUMN_DISC_NUMBER = 0x0800, /* Add new entries here and update the COLUMN_END value*/ - COLUMN_END = 0x0800 + COLUMN_END = 0x1000 }; #define COLUMN_DEFAULT (COLUMN_TITLE|COLUMN_DURATION|COLUMN_ALBUM) @@ -65,6 +66,7 @@ static inline const char * psz_column_title( uint32_t i_column ) case COLUMN_URI: return _("URI"); case COLUMN_RATING: return VLC_META_RATING; case COLUMN_COVER: return _("Cover"); + case COLUMN_DISC_NUMBER: return VLC_META_DISCNUMBER; default: abort(); } } @@ -102,6 +104,8 @@ static inline char * psz_column_meta( input_item_t *p_item, uint32_t i_column ) return input_item_GetRating( p_item ); case COLUMN_COVER: return input_item_GetArtworkURL( p_item ); + case COLUMN_DISC_NUMBER: + return input_item_GetDiscNumber( p_item ); default: abort(); } @@ -122,6 +126,7 @@ static inline int i_column_sorting( uint32_t i_column ) case COLUMN_DESCRIPTION: return SORT_DESCRIPTION; case COLUMN_URI: return SORT_URI; case COLUMN_RATING: return SORT_RATING; + case COLUMN_DISC_NUMBER: return SORT_DISC_NUMBER; default: abort(); } } @@ -141,6 +146,7 @@ static inline ml_select_e meta_to_mlmeta( uint32_t i_column ) case COLUMN_URI: return ML_URI; case COLUMN_RATING: return ML_VOTE; case COLUMN_COVER: return ML_COVER; + case COLUMN_DISC_NUMBER: return ML_DISC_NUMBER; default: abort(); } } diff --git a/modules/gui/qt/components/playlist/standardpanel.cpp b/modules/gui/qt/components/playlist/standardpanel.cpp index 2f8a675..26f0657 100644 --- a/modules/gui/qt/components/playlist/standardpanel.cpp +++ b/modules/gui/qt/components/playlist/standardpanel.cpp @@ -247,7 +247,7 @@ bool StandardPLPanel::popup( const QPoint &point ) QMenu *sortingMenu = new QMenu( qtr( "Sort by" ), &menu ); /* Choose what columns to show in sorting menu, not sure if this should be configurable*/ QList<int> sortingColumns; - sortingColumns << COLUMN_TITLE << COLUMN_ARTIST << COLUMN_ALBUM << COLUMN_TRACK_NUMBER << COLUMN_URI; + sortingColumns << COLUMN_TITLE << COLUMN_ARTIST << COLUMN_ALBUM << COLUMN_TRACK_NUMBER << COLUMN_URI << COLUMN_DISC_NUMBER; container.action = VLCModelSubInterface::ACTION_SORT; foreach( int Column, sortingColumns ) { _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
