[vlc-devel] [PATCH 5/7] qt: expose parsing completion in network model
Pierre Lamot
pierre at videolabs.io
Tue Oct 22 11:35:24 CEST 2019
Hi,
>> a/modules/gui/qt/components/mediacenter/mlnetworkmediamodel.cpp
>> b/modules/gui/qt/components/mediacenter/mlnetworkmediamodel.cpp
>> index f1a15d020f..e8f8609187 100644
>> --- a/modules/gui/qt/components/mediacenter/mlnetworkmediamodel.cpp
>> +++ b/modules/gui/qt/components/mediacenter/mlnetworkmediamodel.cpp
>> @@ -259,6 +259,9 @@ bool MLNetworkMediaModel::initializeMediaSources()
>>
>>
>> vlc_media_tree_Preparse( tree, libvlc, m_treeItem.media.get() );
>> + m_parsingPending = true;
>> + emit parsingPendingChanged(m_parsingPending);
>> +
>> +void MLNetworkMediaModel::onItemPreparseEnded(MediaSourcePtr
>> mediaSource, input_item_node_t* node, enum input_item_preparse_status
>> status)
>> +{
>> + QMetaObject::invokeMethod(this, [this]() {
>> + m_parsingPending = false;
>> + emit parsingPendingChanged(false);
>> + });
>> +}
>> +
QMetaObject::invokeMethod will call the lambda within the object thread.
>> + inline bool getParsingPending() const { return m_parsingPending;
>> }
>>
>> bool m_canBeIndexed = false;
>> + bool m_parsingPending = false;
>
> Shouldn't this be atomic?
this is only read and set from the object (UI) thread.
More information about the vlc-devel
mailing list