Commit 722ab9f1 authored by Rafaël Carré's avatar Rafaël Carré

playlist-tree has only 2 meaningful values now

parent 1f26dd3f
...@@ -189,8 +189,7 @@ struct playlist_t ...@@ -189,8 +189,7 @@ struct playlist_t
playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */ playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */ playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */
bool b_always_tree;/**< Always display as tree */ bool b_tree; /**< Display as a tree */
bool b_never_tree;/**< Never display as tree */
bool b_doing_ml; /**< Doing media library stuff, bool b_doing_ml; /**< Doing media library stuff,
* get quicker */ * get quicker */
......
...@@ -1121,14 +1121,10 @@ static const char *ppsz_albumart_descriptions[] = ...@@ -1121,14 +1121,10 @@ static const char *ppsz_albumart_descriptions[] =
"The media library is automatically saved and reloaded each time you " \ "The media library is automatically saved and reloaded each time you " \
"start VLC." ) "start VLC." )
#define PLTREE_TEXT N_("Use playlist tree") #define PLTREE_TEXT N_("Display playlist tree")
#define PLTREE_LONGTEXT N_( \ #define PLTREE_LONGTEXT N_( \
"The playlist can use a tree to categorize some items, like the " \ "The playlist can use a tree to categorize some items, like the " \
"contents of a directory. \"Default\" means that the tree will only " \ "contents of a directory." )
"be used when really needed." )
static int pi_pltree_values[] = { 0, 1, 2 };
static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N_("Never") };
/***************************************************************************** /*****************************************************************************
...@@ -1868,9 +1864,7 @@ vlc_module_begin(); ...@@ -1868,9 +1864,7 @@ vlc_module_begin();
add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, false ); add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, false );
add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false ); add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false );
add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false ); add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false );
add_integer( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false );
true );
change_integer_list( pi_pltree_values, ppsz_pltree_descriptions, 0 );
add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, false ); add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, false );
change_need_restart(); change_need_restart();
......
...@@ -62,7 +62,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) ...@@ -62,7 +62,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
static const char playlist_name[] = "playlist"; static const char playlist_name[] = "playlist";
playlist_t *p_playlist; playlist_t *p_playlist;
bool b_save; bool b_save;
int i_tree;
/* Allocate structure */ /* Allocate structure */
p_playlist = vlc_custom_create( p_parent, sizeof( *p_playlist ), p_playlist = vlc_custom_create( p_parent, sizeof( *p_playlist ),
...@@ -95,9 +94,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) ...@@ -95,9 +94,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
p_playlist->b_reset_currently_playing = true; p_playlist->b_reset_currently_playing = true;
p_playlist->last_rebuild_date = 0; p_playlist->last_rebuild_date = 0;
i_tree = var_CreateGetBool( p_playlist, "playlist-tree" ); p_playlist->b_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
p_playlist->b_always_tree = (i_tree == 1);
p_playlist->b_never_tree = (i_tree == 2);
p_playlist->b_doing_ml = false; p_playlist->b_doing_ml = false;
......
...@@ -319,9 +319,6 @@ void playlist_NodesPairCreate( playlist_t *p_playlist, const char *psz_name, ...@@ -319,9 +319,6 @@ void playlist_NodesPairCreate( playlist_t *p_playlist, const char *psz_name,
/** /**
* Get the node in the preferred tree from a node in one of category * Get the node in the preferred tree from a node in one of category
* or onelevel tree. * or onelevel tree.
* For example, for the SAP node, it will return the node in the category
* tree if --playlist-tree is not set to never, because the SAP node prefers
* category
*/ */
playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
playlist_item_t *p_node ) playlist_item_t *p_node )
...@@ -329,7 +326,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, ...@@ -329,7 +326,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
int i; int i;
if( p_node->p_parent == p_playlist->p_root_category ) if( p_node->p_parent == p_playlist->p_root_category )
{ {
if( p_playlist->b_always_tree ) if( p_playlist->b_tree )
return p_node; return p_node;
for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ ) for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ )
{ {
...@@ -340,7 +337,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, ...@@ -340,7 +337,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
} }
else if( p_node->p_parent == p_playlist->p_root_onelevel ) else if( p_node->p_parent == p_playlist->p_root_onelevel )
{ {
if( p_playlist->b_never_tree ) if( !p_playlist->b_tree )
return p_node; return p_node;
for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ ) for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment