mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 09:15:50 +00:00
Add an extra safety measure in case we don't find the toolbar settings.
see r37075--r37079. (I think this commit doesn't need a separate status log message as it fits well in the one committed in r37079.) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37080 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
59d5732815
commit
61e7c1472e
@ -945,7 +945,17 @@ void GuiToolbar::saveSession() const
|
|||||||
void GuiToolbar::restoreSession()
|
void GuiToolbar::restoreSession()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
setVisibility(settings.value(sessionKey() + "/visibility").toInt());
|
int const error_val = -1;
|
||||||
|
int visibility =
|
||||||
|
settings.value(sessionKey() + "/visibility", error_val).toInt();
|
||||||
|
if (visibility == error_val || visibility == 0) {
|
||||||
|
// This should not happen, but in case it does, we use the defaults
|
||||||
|
LYXERR0("Session settings could not be found!. "
|
||||||
|
"Defaults are used instead");
|
||||||
|
visibility =
|
||||||
|
guiApp->toolbars().defaultVisibility(fromqstr(objectName()));
|
||||||
|
}
|
||||||
|
setVisibility(visibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user