]> git.lyx.org Git - lyx.git/blobdiff - src/ConverterCache.cpp
Fix up the InsetMathGrid output: detect better if we have a table, and
[lyx.git] / src / ConverterCache.cpp
index 335de9de241ffb98c796bb3a39d4a1fc43294d9b..56a39c775d76da772180919699623742d7a34c99 100644 (file)
@@ -216,9 +216,6 @@ ConverterCache::ConverterCache()
 
 ConverterCache::~ConverterCache()
 {
-       if (!lyxrc.use_converter_cache)
-               return;
-       pimpl_->writeIndex();
        delete pimpl_;
 }
 
@@ -248,6 +245,12 @@ void ConverterCache::init()
 }
 
 
+void ConverterCache::writeIndex() const
+{
+       pimpl_->writeIndex();
+}
+
+
 void ConverterCache::add(FileName const & orig_from, string const & to_format,
                FileName const & converted_file) const
 {
@@ -287,7 +290,8 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                        return;
                }
                item->checksum = checksum;
-               if (!mover.copy(converted_file, item->cache_name)) {
+               if (!mover.copy(converted_file, item->cache_name,
+                             onlyFilename(item->cache_name.absFilename()))) {
                        LYXERR(Debug::FILES, "Could not copy file " << orig_from << " to "
                                << item->cache_name);
                } else if (!item->cache_name.changePermission(0600)) {
@@ -297,7 +301,8 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
        } else {
                CacheItem new_item(orig_from, to_format, timestamp,
                                orig_from.checksum());
-               if (mover.copy(converted_file, new_item.cache_name)) {
+               if (mover.copy(converted_file, new_item.cache_name,
+                             onlyFilename(new_item.cache_name.absFilename()))) {
                        if (!new_item.cache_name.changePermission(0600)) {
                                LYXERR(Debug::FILES, "Could not change file mode"
                                        << new_item.cache_name);
@@ -433,7 +438,8 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
        CacheItem * const item = pimpl_->find(orig_from, to_format);
        LASSERT(item, /**/);
        Mover const & mover = getMover(to_format);
-       return mover.copy(item->cache_name, dest);
+       return mover.copy(item->cache_name, dest,
+                         onlyFilename(dest.absFilename()));
 }
 
 } // namespace lyx