On 01/06/2016 09:42, Nick Dedekind wrote:
>> +{
>> >+ auto surfaceList = const_cast<unityapp::MirSurfaceListInterface*>(&surfaceListConst);
> It seems strange to have to const cast, since we shouldn't be modifying the list.
> I notice you have a const get in the qtmir::MirSurfaceModel.
>
unity::shell::application::MirSurfaceListInterface::get is not const.
And that's the class/interface used here, not qtmir::MirSurfaceModel.
That way it works with both ProxySurfaceListModel and MirSurfaceListModel.
But yes, it would be good to have a const version of get() in
unity::shell::application::MirSurfaceListInterface so this cast would
not be needed.
On 01/06/2016 09:42, Nick Dedekind wrote: unityapp: :MirSurfaceList Interface* >(&surfaceListC onst); MirSurfaceModel .
>> +{
>> >+ auto surfaceList = const_cast<
> It seems strange to have to const cast, since we shouldn't be modifying the list.
> I notice you have a const get in the qtmir::
>
unity:: shell:: application: :MirSurfaceList Interface: :get is not const. MirSurfaceModel .
And that's the class/interface used here, not qtmir::
That way it works with both ProxySurfaceLis tModel and MirSurfaceListM odel.
But yes, it would be good to have a const version of get() in shell:: application: :MirSurfaceList Interface so this cast would
unity::
not be needed.