]> git.lyx.org Git - lyx.git/blobdiff - src/ConverterCache.cpp
Revert part of 21965 which was debugging code.
[lyx.git] / src / ConverterCache.cpp
index c61c8554e4a2b066e8576d53461719ed09faf06c..fe5e813fb5335ddbc201f2790c3773b8e7e27a69 100644 (file)
@@ -18,9 +18,9 @@
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "Mover.h"
-#include "debug.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/lyxtime.h"
@@ -28,7 +28,6 @@
 
 #include <boost/assert.hpp>
 #include <boost/crc.hpp>
-#include <boost/current_function.hpp>
 
 #include <algorithm>
 #include <fstream>
@@ -69,7 +68,7 @@ public:
                cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
                LYXERR(Debug::FILES, "Add file cache item " << orig_from
                                     << ' ' << to_format << ' ' << cache_name
-                                    << ' ' << timestamp << ' ' << checksum << '.');
+                                    << ' ' << long(timestamp) << ' ' << checksum << '.');
        }
        ~CacheItem() {}
        FileName cache_name;
@@ -258,7 +257,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
        if (!lyxrc.use_converter_cache || orig_from.empty() ||
            converted_file.empty())
                return;
-       LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
+       LYXERR(Debug::FILES, ' ' << orig_from
                             << ' ' << to_format << ' ' << converted_file);
 
        // FIXME: Should not hardcode this (see bug 3819 for details)
@@ -285,7 +284,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                }
                // Maybe the contents is still the same?
                item->timestamp = timestamp;
-               unsigned long const checksum = support::sum(orig_from);
+               unsigned long const checksum = orig_from.checksum();
                if (checksum == item->checksum) {
                        LYXERR(Debug::FILES, "Same checksum.");
                        return;
@@ -298,7 +297,7 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
                }
        } else {
                CacheItem new_item(orig_from, to_format, timestamp,
-                               support::sum(orig_from));
+                               orig_from.checksum());
                if (mover.copy(converted_file, new_item.cache_name,
                               support::onlyFilename(new_item.cache_name.absFilename()), 0600)) {
                        FormatCache & format_cache = pimpl_->cache[orig_from];
@@ -318,8 +317,7 @@ void ConverterCache::remove(FileName const & orig_from,
 {
        if (!lyxrc.use_converter_cache || orig_from.empty())
                return;
-       LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
-                            << ' ' << to_format);
+       LYXERR(Debug::FILES, orig_from << ' ' << to_format);
 
        CacheType::iterator const it1 = pimpl_->cache.find(orig_from);
        if (it1 == pimpl_->cache.end())
@@ -379,8 +377,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
 {
        if (!lyxrc.use_converter_cache || orig_from.empty())
                return false;
-       LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
-                            << ' ' << to_format);
+       LYXERR(Debug::FILES, orig_from << ' ' << to_format);
 
        CacheItem * const item = pimpl_->find(orig_from, to_format);
        if (!item) {
@@ -392,7 +389,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
                LYXERR(Debug::FILES, "identical timestamp.");
                return true;
        }
-       if (item->checksum == support::sum(orig_from)) {
+       if (item->checksum == orig_from.checksum()) {
                item->timestamp = timestamp;
                LYXERR(Debug::FILES, "identical checksum.");
                return true;
@@ -405,8 +402,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
 FileName const & ConverterCache::cacheName(FileName const & orig_from,
                string const & to_format) const
 {
-       LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
-                            << ' ' << to_format);
+       LYXERR(Debug::FILES, orig_from << ' ' << to_format);
 
        CacheItem * const item = pimpl_->find(orig_from, to_format);
        BOOST_ASSERT(item);
@@ -419,8 +415,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
 {
        if (!lyxrc.use_converter_cache || orig_from.empty() || dest.empty())
                return false;
-       LYXERR(Debug::FILES, BOOST_CURRENT_FUNCTION << ' ' << orig_from
-                            << ' ' << to_format << ' ' << dest);
+       LYXERR(Debug::FILES, orig_from << ' ' << to_format << ' ' << dest);
 
        // FIXME: Should not hardcode this (see bug 3819 for details)
        if (to_format == "pstex") {