This commit is contained in:
Guillaume MM 2017-05-02 00:28:22 +02:00
parent 1f241dc849
commit 6b64d462ef

View File

@ -335,24 +335,19 @@ void ViewSourceWidget::updateDefaultFormat(BufferView const & bv)
QSignalBlocker blocker(outputFormatCO); QSignalBlocker blocker(outputFormatCO);
outputFormatCO->clear(); outputFormatCO->clear();
outputFormatCO->addItem(qt_("Default"), outputFormatCO->addItem(qt_("Default"),
QVariant(QString("default"))); QVariant(QString("default")));
int index = 0; int index = 0;
vector<string> tmp = bv.buffer().params().backends(); for (string const & fmt_name : bv.buffer().params().backends()) {
vector<string>::const_iterator it = tmp.begin(); Format const * fmt = theFormats().getFormat(fmt_name);
vector<string>::const_iterator en = tmp.end();
for (; it != en; ++it) {
string const format = *it;
Format const * fmt = theFormats().getFormat(format);
if (!fmt) { if (!fmt) {
LYXERR0("Can't find format for backend " << format << "!"); LYXERR0("Can't find format for backend " << fmt_name << "!");
continue; continue;
} }
QString const pretty = toqstr(translateIfPossible(fmt->prettyname())); QString const pretty = toqstr(translateIfPossible(fmt->prettyname()));
outputFormatCO->addItem(pretty, QVariant(toqstr(format))); outputFormatCO->addItem(pretty, QVariant(toqstr(fmt_name)));
if (format == view_format_) if (fmt_name == view_format_)
index = outputFormatCO->count() -1; index = outputFormatCO->count() - 1;
} }
setViewFormat(index); setViewFormat(index);
} }
@ -370,6 +365,7 @@ void ViewSourceWidget::resizeEvent (QResizeEvent * event)
QWidget::resizeEvent(event); QWidget::resizeEvent(event);
} }
void ViewSourceWidget::saveSession(QString const & session_key) const void ViewSourceWidget::saveSession(QString const & session_key) const
{ {
QSettings settings; QSettings settings;