{
d->bibinfo_cache_valid_ = false;
d->cite_labels_valid_ = false;
- removeBiblioTempFiles();
+ scheduleBiblioTempRemoval();
// also invalidate the cache for the parent buffer
Buffer const * const pbuf = d->parent();
if (pbuf)
Buffer const * const pbuf = parent();
if (pbuf)
pbuf->removeBiblioTempFiles();
+ removeBiblioTemps = false;
}
Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir,
bool includeall, string & result_file) const
{
+ if (removeBiblioTemps)
+ removeBiblioTempFiles();
LYXERR(Debug::FILES, "target=" << target);
OutputParams runparams(¶ms().encoding());
string format = target;
/// dereferenced label name
void getLabelList(std::vector<std::tuple<docstring, docstring, docstring>> &) const;
- /// This removes the .aux and .bbl files from the temp dir.
- void removeBiblioTempFiles() const;
-
///
void changeLanguage(Language const * from, Language const * to);
///
ExportStatus doExport(std::string const & target, bool put_in_tempdir,
std::string & result_file) const;
+ /// This removes the .aux and .bbl files from the temp dir.
+ void removeBiblioTempFiles() const;
/// target is a format name optionally followed by a space
/// and a destination file-name
ExportStatus doExport(std::string const & target, bool put_in_tempdir,
/// of loaded child documents).
docstring_list const &
getBibfiles(UpdateScope scope = UpdateMaster) const;
-
+ ///
+ void scheduleBiblioTempRemoval() const { removeBiblioTemps = true; }
/// routines for dealing with possible self-inclusion
void pushIncludedBuffer(Buffer const * buf) const;
void popIncludedBuffer() const;
bool isBufferIncluded(Buffer const * buf) const;
private:
void clearIncludeList() const;
-
-private:
+ ///
friend class MarkAsExporting;
/// mark the buffer as busy exporting something, or not
void setExportStatus(bool e) const;
+ ///
+ mutable bool removeBiblioTemps = false;
///
References & getReferenceCache(docstring const & label);
string last_export_format;
string processing_format;
+ // Buffers that are being exported
static QSet<Buffer const *> busyBuffers;
unsigned int smallIconSize;
InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
: InsetCommand(buf, p)
{
- buffer().removeBiblioTempFiles();
+ buffer().scheduleBiblioTempRemoval();
cleanKeys();
}
/* We do not use buffer() because Coverity believes that this
* may throw an exception. Actually this code path is not
* taken when buffer_ == 0 */
- buffer_->removeBiblioTempFiles();
+ buffer_->scheduleBiblioTempRemoval();
}
openCitation();
break;
case LFUN_INSET_MODIFY: {
- buffer().removeBiblioTempFiles();
+ buffer().scheduleBiblioTempRemoval();
cache.recalculate = true;
if (cmd.getArg(0) == "toggleparam") {
string cmdname = getCmdName();