vlc_linux/vlc-3.0.16/modules/gui/qt/components/playlist/playlist_model.cpp
/* Seek from current index toward the top and see if index is one of parent nodes */
Seek from current index toward the top and see if index is one of parent nodes
Seek from current index toward the top and see if index is one of parent nodes
bool PLModel::isParent( const QModelIndex &index, const QModelIndex &current ) const
{
    if( !index.isValid() )
        return false;
    if( index == current )
        return true;
    if( !current.isValid() || !current.parent().isValid() )
        return false;
    return isParent( index, current.parent() );
}
bool PLModel :: isParent ( const QModelIndex & index , const QModelIndex & current ) const { if ( ! index . isValid ( ) ) return false ; if ( index == current ) return true ; if ( ! current . isValid ( ) || ! current . parent ( ) . isValid ( ) ) return false ; return isParent ( index , current . parent ( ) ) ; }
Seek from current index toward the top and see if index is one of parent nodes
Seek from current index toward the top and see if index is one of parent nodes