hpereiradacosta added inline comments.

INLINE COMMENTS

> breezehelper.cpp:1613
> +
> +        auto castedWidget = const_cast<QWidget*>(widget);
> +

as far as I can tell you do not need the const_cast. just check the relevant 
methods to take a const as input. 
Const_cast must really be avoided as much as possible. 
I see that it is needed just for the call to window->toolBarArea. If so, just 
do the const_cast there and keep all the rest const.
(window->toolBarArea(const_cast<QToolBar*>(toolbar)))

> hpereiradacosta wrote in breezestyle.cpp:4579
> Are you sure about the logic here ? geometry is relative to the parent 
> corrdinate system while childrenRect is relative to current widget. 
> Also, I would as expected that opt->rect would have been enough in any case 
> without the need to resort to the widget accessors

Here at least, using opt->rect directly (no need for the copy), fixes the 
multiple toolbar issue, with no regression elsewhere.
No regression on the menubar empty area either.

> breezestyle.cpp:4890
> +    {
> +        auto toolbar = const_cast<QToolBar*>(qobject_cast<const 
> QToolBar*>(widget));
> +

as far as I can tell you dont need the cast to QToolbar. Just use the widget.
(and in any case if you use the toolbar you must make sure that the case 
succeeded.)

REPOSITORY
  R31 Breeze

REVISION DETAIL
  https://phabricator.kde.org/D27669

To: cblack, #plasma, #breeze, #vdg
Cc: IlyaBizyaev, davidre, davidedmundson, hpereiradacosta, gvgeo, ngraham, 
manueljlin, niccolove, ndavis, plasma-devel, Orage, LeGast00n, 
The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, 
ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, 
apol, ahiemstra, mart

Reply via email to