Pavel Sanda wrote:
> i started to fix the original report but as i went in more and more
> problems appear and 'proper' fix will need major review od converter
> cache code. partial fix is oneliner.

after some thinking i came to simpler draft:
lets use and manage index files, deletion policy etc. regardless
the state of the settings (cache enabled/disabled).
the only things which could be really disabled would be find & add
routines.
opinions?

i would like somebody makes review of the code with this patch.
pavel
Index: ConverterCache.cpp
===================================================================
--- ConverterCache.cpp	(revision 30943)
+++ ConverterCache.cpp	(working copy)
@@ -216,6 +216,7 @@
 
 ConverterCache::~ConverterCache()
 {
+	// Why? IMHO should be deleted --ps
 	if (!lyxrc.use_converter_cache)
 		return;
 	delete pimpl_;
@@ -232,8 +233,6 @@
 
 void ConverterCache::init()
 {
-	if (!lyxrc.use_converter_cache)
-		return;
 	// We do this here and not in the constructor because package() gets
 	// initialized after all static variables.
 	cache_dir = FileName(addName(package().user_support().absFilename(), "cache"));
@@ -324,7 +323,7 @@
 void ConverterCache::remove(FileName const & orig_from,
 		string const & to_format) const
 {
-	if (!lyxrc.use_converter_cache || orig_from.empty())
+	if (orig_from.empty())
 		return;
 	LYXERR(Debug::FILES, orig_from << ' ' << to_format);
 
@@ -345,8 +344,6 @@
 void ConverterCache::remove_all(string const & from_format,
 		string const & to_format) const
 {
-	if (!lyxrc.use_converter_cache)
-		return;
 	CacheType::iterator it1 = pimpl_->cache.begin();
 	while (it1 != pimpl_->cache.end()) {
 		if (it1->second.from_format != from_format) {

Reply via email to