On Mon, Oct 01, 2007 at 11:34:38AM +0200, Edwin Leuven wrote:
> Jürgen Spitzmüller wrote:
> >Do you have some (subjective or objective) measures on the speed
> >improvement?
>
> no, but richard was complaining that the panels took a bit of time to update
>
> >I.e., is it worth to shove this in for 1.5.2? I take it that the risks are
> >low (my previous question).
>
> as i wrote risk for our own panels is zero
>
> patch for 1.5 attached. could you apply it if you want it?
>
>
> Index: src/frontends/qt4/IconPalette.cpp
> ===================================================================
> --- src/frontends/qt4/IconPalette.cpp (revision 20627)
> +++ src/frontends/qt4/IconPalette.cpp (working copy)
> @@ -208,11 +208,9 @@
> void IconPalette::updateParent()
> {
> bool enable = false;
> - for (int i = 0; i < actions_.size(); ++i)
> - if (actions_.at(i)->isEnabled()) {
> - enable = true;
> - break;
> - }
> + // we check only the 1st action to enabled/disable the panel
> + if (actions_.size() > 0)
Generally spoken, foo.size() > 0 has the potential of beeing slower
than !foo.isEmpty().
Andre'