playlist-tree has only 2 meaningful values now
authorRafaël Carré <funman@videolan.org>
Tue, 22 Apr 2008 17:51:33 +0000 (19:51 +0200)
committerRafaël Carré <funman@videolan.org>
Tue, 22 Apr 2008 17:51:49 +0000 (19:51 +0200)
include/vlc_playlist.h
src/libvlc-module.c
src/playlist/engine.c
src/playlist/tree.c

index acddcf4..baa2217 100644 (file)
@@ -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 */
index 8f74f2a..3940aa1 100644 (file)
@@ -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();
index 7a5baf7..70e1560 100644 (file)
@@ -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;
 
index d4c8c49..4b4b95b 100644 (file)
@@ -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++ )
         {