From 3294b16bf65c6776879e471da9c7466d1ea08abe Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 16 Sep 2016 19:39:53 +0200 Subject: [PATCH] Keep citation style settings bot within and between sessions. Fixes: #10256 --- src/frontends/qt4/GuiCitation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index a7b4af5c04..8972c864eb 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -307,7 +307,8 @@ void GuiCitation::updateStyles(BiblioInfo const & bi) citationStyleCO->blockSignals(true); // save old index - int const oldIndex = citationStyleCO->currentIndex(); + int const curindex = citationStyleCO->currentIndex(); + int const oldIndex = (curindex < 0) ? style_ : curindex; citationStyleCO->clear(); citationStyleCO->insertItems(0, sty); citationStyleCO->setEnabled(true); @@ -822,6 +823,8 @@ void GuiCitation::saveSession() const sessionKey() + "/casesensitive", casesense_->isChecked()); settings.setValue( sessionKey() + "/autofind", instant_->isChecked()); + settings.setValue( + sessionKey() + "/citestyle", style_); } @@ -832,6 +835,7 @@ void GuiCitation::restoreSession() regexp_->setChecked(settings.value(sessionKey() + "/regex").toBool()); casesense_->setChecked(settings.value(sessionKey() + "/casesensitive").toBool()); instant_->setChecked(settings.value(sessionKey() + "/autofind").toBool()); + style_ = settings.value(sessionKey() + "/citestyle").toInt(); updateFilterHint(); }