>
> But somehow there is a connection between visibility flags and the
> toolbar type, isn't it? The allowauto_ flag depends on visibility.
> This looks a little bit weird.


Yes, this is just an example of bad programming practice.

In the Visibility enum, we are now mixing up flags indicating where to
show and when to show a toolbar. This seems bad, but ok.

But then GuiToolbar::setVisibility says that all items in the
Visibility enum >= Toolbars::MATH are auto_toggling. This is just bad,
because someone else adds a new item to the Visibility enum and can't
possibly know that somewhere else in the code, this new item implies a
different behaviour because it's added to the end.

So, when the SAMEROW flag is set, we also set allow_auto_, which is a BUG.

I guess allowauto_ should be something like:

{{{
...
enum Visibility {
....
ALLOWAUTO = MATH | TABLE | REVIEW | MATHMACROTEMPLATE;
...
}

allowauto_ = visibility & Toolbars::ALLOWAUTO;

}}}


>
>> Furthermore, I'm not sure yet what causes the bug, because it seems
>> that if the user sets the toolbar visibility from within LyX, this
>> setting is lost again on the new start-up of LyX.
>
> The wrong settings are saved again?
>
> Perhaps it's not a failure of restoreSession but a save of wrong
> toolbar settings. I cannot tell for sure.

You can find out if you can reproduce the bug ;).


> In any case it shouldn't happen that visibility is restored as 0.

No, if we can't restore from QSettings, we should set the visibility
to the default I guess.

Vincent

Reply via email to