vlc_linux/vlc-3.0.16/modules/gui/qt/components/complete_preferences.cpp
/* Updates the PrefsItemData loaded status to reflect currently
 * running modules */
Updates the PrefsItemData loaded status to reflect currently
running modules
Updates the PrefsItemData loaded status to reflect currently running modules
void PrefsTree::updateLoadedStatus( QTreeWidgetItem *item = NULL,
                                    QSet<QString> *loaded = NULL )
{
    bool b_release = false;
    if( loaded == NULL )
    {
        vlc_object_t *p_root = VLC_OBJECT( p_intf->obj.libvlc );
        loaded = new QSet<QString>();
        populateLoadedSet( loaded, p_root );
        b_release = true;
    }
    if ( item == NULL )
    {
        for( int i = 0 ; i < topLevelItemCount(); i++ )
            updateLoadedStatus( topLevelItem( i ), loaded );
    }
    else
    {
        PrefsItemData *data = item->data( 0, Qt::UserRole )
                .value<PrefsItemData *>();
        data->b_loaded = loaded->contains( QString( data->psz_shortcut ) );
        for( int i = 0; i < item->childCount(); i++ )
            updateLoadedStatus( item->child( i ), loaded );
    }
    if ( b_release )
        delete loaded;
}
void PrefsTree :: updateLoadedStatus ( QTreeWidgetItem * item = NULL , QSet < QString > * loaded = NULL ) { bool b_release = false ; if ( loaded == NULL ) { vlc_object_t * p_root = VLC_OBJECT ( p_intf -> obj . libvlc ) ; loaded = new QSet < QString > ( ) ; populateLoadedSet ( loaded , p_root ) ; b_release = true ; } if ( item == NULL ) { for ( int i = 0 ; i < topLevelItemCount ( ) ; i ++ ) updateLoadedStatus ( topLevelItem ( i ) , loaded ) ; } else { PrefsItemData * data = item -> data ( 0 , Qt :: UserRole ) . value < PrefsItemData * > ( ) ; data -> b_loaded = loaded -> contains ( QString ( data -> psz_shortcut ) ) ; for ( int i = 0 ; i < item -> childCount ( ) ; i ++ ) updateLoadedStatus ( item -> child ( i ) , loaded ) ; } if ( b_release ) delete loaded ; }
Updates the PrefsItemData loaded status to reflect currently
 running modules
Updates the PrefsItemData loaded status to reflect currently running modules