Logo Search packages:      
Sourcecode: bangarang version File versions  Download package

void MediaItemModel::loadMediaList ( const QList< MediaItem > &  mediaList,
bool  emitMediaListChanged = false,
bool  updateExisting = false 
)

Loads a list of MediaItems directly into the model

Parameters:
mediaList list of MediaItems to load
Note: After using this method, MediaListProperties returned by mediaListProperties() is likely stale. MediaListProperties.lri should either be updated to correspond to mediaList or set to QString().

Definition at line 170 of file mediaitemmodel.cpp.

References loadMediaItem(), mediaListChanged(), replaceMediaItemAt(), and rowOfUrl().

Referenced by Playlist::playItemAt().

{
    for (int i = 0 ; i < mediaList.count() ; ++i) {
        if (updateExisting) {
            int rowOfExisting = rowOfUrl(mediaList.at(i).url);
            if (rowOfExisting != -1) {
                replaceMediaItemAt(rowOfExisting, mediaList.at(i));
            } else {
                loadMediaItem(mediaList.at(i));
            }
        } else {
            loadMediaItem(mediaList.at(i));
        }
    }
    if (emitMediaListChanged) {
        emit mediaListChanged();
    }
}


Generated by  Doxygen 1.6.0   Back to index