From d0f928f66a59f9a4f1d36bd1b3a89198eda8805c Mon Sep 17 00:00:00 2001
From: Geoffroy Couprie <geo.couprie@gmail.com>
Date: Mon, 11 Aug 2008 21:15:52 +0200
Subject: [PATCH] The playlist-tree option is now mandatory. It should fix #1668

---
 include/vlc_playlist.h |    2 --
 src/libvlc-module.c    |    5 -----
 src/playlist/engine.c  |    2 --
 src/playlist/tree.c    |   11 +----------
 4 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 1dcd245..3c95d44 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -185,8 +185,6 @@ 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_tree; /**< Display as a tree */
-
     bool            b_doing_ml; /**< Doing media library stuff,
                                        * get quicker */
     bool            b_auto_preparse;
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index f302c3f..f420ada 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1130,10 +1130,6 @@ static const char *const ppsz_albumart_descriptions[] =
     "The media library is automatically saved and reloaded each time you " \
     "start VLC." )
 
-#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." )
 
 
 /*****************************************************************************
@@ -1878,7 +1874,6 @@ 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_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 bcda392..9ed17be 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -94,8 +94,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
     p_playlist->b_reset_currently_playing = true;
     p_playlist->last_rebuild_date = 0;
 
-    p_playlist->b_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
-
     p_playlist->b_doing_ml = false;
 
     p_playlist->b_auto_preparse =
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index c104518..2480ccb 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -326,19 +326,10 @@ 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_tree )
-            return p_node;
-        for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ )
-        {
-            if( p_playlist->p_root_onelevel->pp_children[i]->p_input->i_id ==
-                    p_node->p_input->i_id )
-                return p_playlist->p_root_onelevel->pp_children[i];
-        }
+        return p_node;
     }
     else if( p_node->p_parent == p_playlist->p_root_onelevel )
     {
-        if( !p_playlist->b_tree )
-            return p_node;
         for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
         {
             if( p_playlist->p_root_category->pp_children[i]->p_input->i_id ==
-- 
1.5.6.4

