}
+// FIXME THREAD
+// This should be OK because it is only assigned during init()
static FileName cache_dir;
class CacheItem {
public:
- CacheItem()
- {}
+ CacheItem() : timestamp(0), checksum(0) {}
CacheItem(FileName const & orig_from, string const & to_format,
time_t t, unsigned long c)
: timestamp(t), checksum(c)
FormatCache & format_cache = cache[orig_from_name];
if (format_cache.from_format.empty())
format_cache.from_format =
- formats.getFormatFromFile(orig_from_name);
+ // FIXME perf: This very expensive function is called on all
+ // cached files on opening. This slows LyX startup a lot. It
+ // would be better if this information was retrieved in a
+ // delayed fashion.
+ theFormats().getFormatFromFile(orig_from_name);
format_cache.cache[to_format] = item;
}
is.close();
FormatCache & format_cache = pimpl_->cache[orig_from];
if (format_cache.from_format.empty())
format_cache.from_format =
- formats.getFormatFromFile(orig_from);
+ theFormats().getFormatFromFile(orig_from);
format_cache.cache[to_format] = new_item;
} else
LYXERR(Debug::FILES, "ConverterCache::add(" << orig_from << "):\n"
LYXERR(Debug::FILES, orig_from << ' ' << to_format);
CacheItem * const item = pimpl_->find(orig_from, to_format);
- LASSERT(item, /**/);
+ LASSERT(item, { static const FileName fn; return fn; });
return item->cache_name;
}
}
CacheItem * const item = pimpl_->find(orig_from, to_format);
- LASSERT(item, /**/);
+ LASSERT(item, return false);
Mover const & mover = getMover(to_format);
return mover.copy(item->cache_name, dest,
onlyFileName(dest.absFileName()));