// No work area, switch to the background widget.
d.setBackground();
+ updateToolbars();
QMainWindow::showEvent(e);
}
= theConverters().importableFormats();
vector<const Format *>::const_iterator it = import_formats.begin();
for (; it != import_formats.end(); ++it)
- if ((*it)->extension() == ext)
+ if ((*it)->hasExtension(ext))
found_formats.push_back(*it);
FuncRequest cmd;
from_master = true;
}
#else
- ErrorList & el = from_master ?
+ ErrorList const & el = from_master ?
bv->buffer().masterBuffer()->errorList(error_type) :
bv->buffer().errorList(error_type);
#endif
return 0;
}
- newBuffer->errors("Parse");
setBuffer(newBuffer);
+ newBuffer->errors("Parse");
if (tolastfiles)
theSession().lastFiles().add(filename);
toqstr(addPath(package().system_support().absFileName(), "examples")));
docstring filter = formats.prettyName(format);
- filter += " (*.";
+ filter += " (*.{";
// FIXME UNICODE
- filter += from_utf8(formats.extension(format));
- filter += ')';
+ filter += from_utf8(formats.extensions(format));
+ filter += "})";
FileDialog::Result result =
dlg.open(toqstr(initpath), fileFilters(toqstr(filter)));
return false;
}
}
+ if (!buf) {
+ message(bformat(
+ _("No buffer for file: %1$s."),
+ makeDisplayPath(file_name))
+ );
+ return false;
+ }
setBuffer(buf);
documentBufferView()->setCursorFromRow(row);
return true;
buffer->params().maintain_unincluded_children
&& !buffer->params().getIncludedChildren().empty();
bool const success = func(format, update_unincluded);
- delete buffer;
+
+ // the cloning operation will have produced a clone of the entire set of
+ // documents, starting from the master. so we must delete those.
+ Buffer * mbuf = const_cast<Buffer *>(buffer->masterBuffer());
+ delete mbuf;
busyBuffers.remove(orig);
if (msg == "preview") {
return success
#if QT_VERSION < 0x040400
if (!doc_buffer->doExport(argument, false)) {
dr.setError(true);
- dr.setMessage(bformat(_("Error exporting to format: %1$s."),
+ dr.setMessage(bformat(_("Error exporting to format: %1$s"),
cmd.argument()));
}
#else