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

Benjamin Arnaud bunjee at omega.gg
Wed Mar 17 10:00:43 UTC 2021


OK, let me know if this implementation works better for you -> 
https://code.videolan.org/bunjee/vlc/-/merge_requests/7

Feel free to comment directly on the MR.

---
Benjamin Arnaud

Le 2021-03-16 12:20, Romain Vimont a écrit :
> On Tue, Mar 16, 2021 at 11:47:14AM +0100, Pierre Lamot wrote:
>> 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.
> 
> OK, thank you for the explanations.
> 
>> 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


More information about the vlc-devel mailing list