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

Romain Vimont rom1v at videolabs.io
Tue Mar 16 10:14:46 UTC 2021


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.

Regards

> > > +
> > > +    m_data.append(error);
> > > +
> > > +    emit errorEnd();


More information about the vlc-devel mailing list