Unlike other options in the OptionsDialog, the theme change was
done when selecting a new theme and not when clicking on OK or
Apply. This commit makes it consistent with other options
The issue could occur when adding or removing widgets to a tab, and then
not switching to a different tab before the destructor or reflowLayout() were
called. In such a case the firstWidget of the current widget in the _tabs list
could be out of date. Accessing this first widget from the destructor or from
reflowLayout() could then cause a crash, or random issues caused to access
to free'ed memory. In theory this could also lead to a memory leak, although
I don't think this could occur in our current code.
Usually we add several tabs to a TabWidget and then switch back to the first
tab after building all the tabs. So in such a case the issue would not occur.
But because we are deleting and reconstructing the clear buttons for the
MIDI and Path tabs of the options dialog from reflowLayout(), if the current
tab is the Path tab, it would be kept as active tab after adding and removing
widget to it and the issue would occur.
This fixes bug #9618.
A value of 0 is valid for tab ids, so the correct initialisation at this
stage is -1. However only one constructor properly initialized all the
tab ids to -1 in its initialisation list, but it was then changed to 0 in
init(). I have added the missing ones to the other constructors and
removed the incorrect ones in init(). But maybe all tab ids should be
initialised in init() rather than in the constructors initialisation lists.
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.
Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.