Commit 6baf831c authored by Geoffroy Couprie's avatar Geoffroy Couprie Committed by Jean-Baptiste Kempf

Add tree-view for SD only

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6648b4c1
...@@ -73,6 +73,7 @@ struct input_item_t ...@@ -73,6 +73,7 @@ struct input_item_t
mtime_t i_duration; /**< Duration in milliseconds*/ mtime_t i_duration; /**< Duration in milliseconds*/
uint8_t i_type; /**< Type (file, disc, ...) */ uint8_t i_type; /**< Type (file, disc, ...) */
bool b_prefers_tree; /**< Do we prefer being displayed as tree*/
int i_categories; /**< Number of info categories */ int i_categories; /**< Number of info categories */
info_category_t **pp_categories; /**< Pointer to the first info category */ info_category_t **pp_categories; /**< Pointer to the first info category */
......
...@@ -543,6 +543,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri, ...@@ -543,6 +543,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
p_input->psz_uri = NULL; p_input->psz_uri = NULL;
p_input->i_type = i_type; p_input->i_type = i_type;
p_input->b_prefers_tree = false;
if( p_input->i_type == ITEM_TYPE_UNKNOWN ) if( p_input->i_type == ITEM_TYPE_UNKNOWN )
GuessType( p_input ); GuessType( p_input );
......
...@@ -355,6 +355,9 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu ...@@ -355,6 +355,9 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
p_sds = malloc( sizeof(struct playlist_services_discovery_support_t) ); p_sds = malloc( sizeof(struct playlist_services_discovery_support_t) );
if( !p_sds ) if( !p_sds )
return VLC_ENOMEM; return VLC_ENOMEM;
/* We want tree-view for service directory */
p_one->p_input->b_prefers_tree = true;
p_sds->p_sd = p_sd; p_sds->p_sd = p_sd;
p_sds->p_one = p_one; p_sds->p_one = p_one;
p_sds->p_cat = p_cat; p_sds->p_cat = p_cat;
......
...@@ -336,7 +336,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, ...@@ -336,7 +336,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_tree ) if( p_playlist->b_tree || p_node->p_input->b_prefers_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++ )
{ {
...@@ -347,7 +347,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, ...@@ -347,7 +347,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_tree ) if( !p_playlist->b_tree || !p_node->p_input->b_prefers_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