[vlc-devel] commit: playlist-tree has only 2 meaningful values now ( Rafaël Carré )
git version control
git at videolan.org
Tue Apr 22 20:00:28 CEST 2008
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Apr 22 19:51:33 2008 +0200| [722ab9f14ee31f8f0633cfc7a0b79401c47316fe]
playlist-tree has only 2 meaningful values now
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=722ab9f14ee31f8f0633cfc7a0b79401c47316fe
---
include/vlc_playlist.h | 3 +--
src/libvlc-module.c | 12 +++---------
src/playlist/engine.c | 5 +----
src/playlist/tree.c | 7 ++-----
4 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index acddcf4..baa2217 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -189,8 +189,7 @@ struct playlist_t
playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */
- bool b_always_tree;/**< Always display as tree */
- bool b_never_tree;/**< Never display as tree */
+ bool b_tree; /**< Display as a tree */
bool b_doing_ml; /**< Doing media library stuff,
* get quicker */
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 8f74f2a..3940aa1 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1121,14 +1121,10 @@ static const char *ppsz_albumart_descriptions[] =
"The media library is automatically saved and reloaded each time you " \
"start VLC." )
-#define PLTREE_TEXT N_("Use playlist tree")
+#define PLTREE_TEXT N_("Display playlist tree")
#define PLTREE_LONGTEXT N_( \
"The playlist can use a tree to categorize some items, like the " \
- "contents of a directory. \"Default\" means that the tree will only " \
- "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") };
-
+ "contents of a directory." )
/*****************************************************************************
@@ -1868,9 +1864,7 @@ vlc_module_begin();
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( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false );
- add_integer( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT,
- true );
- change_integer_list( pi_pltree_values, ppsz_pltree_descriptions, 0 );
+ add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false );
add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, false );
change_need_restart();
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 7a5baf7..70e1560 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -62,7 +62,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
static const char playlist_name[] = "playlist";
playlist_t *p_playlist;
bool b_save;
- int i_tree;
/* Allocate structure */
p_playlist = vlc_custom_create( p_parent, sizeof( *p_playlist ),
@@ -95,9 +94,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
p_playlist->b_reset_currently_playing = true;
p_playlist->last_rebuild_date = 0;
- i_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_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
p_playlist->b_doing_ml = false;
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index d4c8c49..4b4b95b 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -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
* 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 *p_node )
@@ -329,7 +326,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
int i;
if( p_node->p_parent == p_playlist->p_root_category )
{
- if( p_playlist->b_always_tree )
+ if( p_playlist->b_tree )
return p_node;
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,
}
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;
for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
{
More information about the vlc-devel
mailing list