}
-docstring ViewSourceWidget::currentFormatName() const
+docstring ViewSourceWidget::currentFormatName(BufferView const * bv) const
{
// Compute the actual format used
- string const format = !bv_ ? ""
- : flavor2format(bv_->buffer().params().getOutputFlavor(view_format_));
+ string const format = !bv ? ""
+ : flavor2format(bv->buffer().params().getOutputFlavor(view_format_));
Format const * f = formats.getFormat(format.empty() ? view_format_ : format);
return from_utf8(f ? f->prettyname() : view_format_);
}
void GuiViewSource::updateTitle()
{
- docstring const format = widget_->currentFormatName();
+ docstring const format = widget_->currentFormatName(bufferview());
QString const title = format.empty() ? qt_("Code Preview")
: qt_("%1[[preview format name]] Preview")
.arg(toqstr(translateIfPossible(format)));
///
void gotoCursor();
/// Name of the current format. Empty if none.
- docstring currentFormatName() const;
+ docstring currentFormatName(BufferView const * bv) const;
Q_SIGNALS:
void formatChanged() const;