[LyX/master] Amend bea7ef04e (find's auto-wrap by default)
Scott Kostyshak
skostysh at lyx.org
Thu Dec 16 02:02:02 UTC 2021
On Thu, Dec 16, 2021 at 02:26:13AM +0100, Scott Kostyshak wrote:
> commit 056ab33f4892d522a154273324dafda08f674bfd
> Author: Scott Kostyshak <skostysh at lyx.org>
> Date: Wed Dec 15 20:48:20 2021 -0500
>
> Amend bea7ef04e (find's auto-wrap by default)
>
> The default in the .ui is not considered in
> GuiSearchWidget::restoreSession(), which sets a hard-coded default
> if the stored setting is not found in the session file.
>
> I'll start an ML discussion for whether the code in restoreSession()
> should use the ui's default if the setting is not found in the
> session.
> ---
> src/frontends/qt/GuiSearch.cpp | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp
> index b071d61..e387ce8 100644
> --- a/src/frontends/qt/GuiSearch.cpp
> +++ b/src/frontends/qt/GuiSearch.cpp
> @@ -555,8 +555,8 @@ void GuiSearchWidget::restoreSession(QString const & session_key)
> act_wholewords_->setChecked(settings.value(session_key + "/words", false).toBool());
> instantSearchCB->setChecked(settings.value(session_key + "/instant", false).toBool());
> act_immediate_->setChecked(settings.value(session_key + "/instant", false).toBool());
> - wrapCB->setChecked(settings.value(session_key + "/wrap", false).toBool());
> - act_wrap_->setChecked(settings.value(session_key + "/wrap", false).toBool());
> + wrapCB->setChecked(settings.value(session_key + "/wrap", true).toBool());
> + act_wrap_->setChecked(settings.value(session_key + "/wrap", true).toBool());
> selectionCB->setChecked(settings.value(session_key + "/selection", false).toBool());
> act_selection_->setChecked(settings.value(session_key + "/selection", false).toBool());
> minimized_ = settings.value(session_key + "/minimized", false).toBool();
If this code does not find an entry in the session file, it then uses
the hard-coded setting here (this is what the commit changes from false
to true). Would it make sense to instead just use the default that is
set in the .ui file?
On the one hand, it took me a while to figure why the .ui file's
settings were ignored. On the other hand, I suppose it is nice to have
all of the defaults here now that I know where to look.
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20211215/8af48c03/attachment.asc>
More information about the lyx-devel
mailing list