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

void MediaItemModel::actionActivated ( QModelIndex  index  )  [slot]

Activate the action associated with "Action" mediaItem at the specified model index.

Parameters:
index QModelIndex of action. (This slot is useful for View ItemDelegates to tell the model to activate the action when clicked. e.g. Open File.)

Definition at line 237 of file mediaitemmodel.cpp.

References ListEngine::activateAction(), ListEngineFactory::availableListEngine(), MediaListProperties::engine(), ListEngineFactory::engineExists(), ListEngineFactory::generateRequestSignature(), MediaListProperties::lri, mediaListProperties(), ListEngine::setMediaListProperties(), and ListEngine::setRequestSignature().

{
    MediaListProperties mediaListProperties;
    mediaListProperties.lri =  itemFromIndex(index)->data(MediaItem::UrlRole).toString();

    if (m_listEngineFactory->engineExists(mediaListProperties.engine())) {
        m_mediaListProperties = mediaListProperties;
        removeRows(0, rowCount());
        setLoadingState(true);
        ListEngine * listEngine = m_listEngineFactory->availableListEngine(m_mediaListProperties.engine());
        m_requestSignature = m_listEngineFactory->generateRequestSignature();
        listEngine->setRequestSignature(m_requestSignature);
        listEngine->setMediaListProperties(m_mediaListProperties);
        listEngine->activateAction();
    }   
}


Generated by  Doxygen 1.6.0   Back to index