[vlc-devel] [PATCH 1/2] qt/dialogmodel: Update error handling before the GUI display

Pierre Lamot pierre at videolabs.io
Tue Mar 16 10:47:14 UTC 2021


On 2021-03-16 11:14, Romain Vimont wrote:
> On Tue, Mar 16, 2021 at 11:01:04AM +0100, Pierre Lamot wrote:
>> On 2021-03-16 10:40, Romain Vimont wrote:
>> > On Tue, Mar 16, 2021 at 10:32:57AM +0100, Benjamin Arnaud wrote:
>> > > +void DialogModel::pushError(const DialogError & error)
>> > > +{
>> > > +    emit errorBegin();
>> >
>> > Why do you use signals/slots here for errorBegin() and errorEnd()?
>> >
>> > I think yoy could directly call the function (currently called
>> > onErrorBegin()), right?
>> >
>> > Regards
>> 
>> actually there are two objects, the DialogModel which handles the 
>> dialog
>> events from the core and the DialogErrorModel wich provides an
>> AbstractListModel interface to represent the error list
>> DialogErrorModel is created on QML side and listen to the events from 
>> the
>> DialogModel, DialogModel doesn't knows about the instances of
>> DialogErrorModel, hence the custom signals
> 
> But then, I find it surprising that m_data does not belong to the
> DialogErrorModel (the object which notifies changes to the that list).
> 
> There might be good reasons (I don't know the details here), but
> typically a Qt list model contains the list of the data it exposes.

We need a single source of storage to store the errors emitted from VLC

the original issue is that the errors emited before the the creation of 
the former DialogModel wheren't catched,
now the DialogModel will listen to the errors since the opening of the 
interface.

So we can't store the error in the DialogErrorModel as it is created on 
Qml side.

Though, what might be a better design is having the DialogErrorModel 
being a sub-property of the DialogModel.

> Regards
> 
>> > > +
>> > > +    m_data.append(error);
>> > > +
>> > > +    emit errorEnd();
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list