X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FConverterCache.cpp;h=0f4d03efb9d42b9b1df356d9d8793cdf09df041c;hb=c9b1b46796923b0453ccaed022448b61b5be6d8a;hp=c601c3f708d8c997018121a5c05da77c2d881eb6;hpb=12d164393e4dd0cc60b48be57e5abf1ba43b23b3;p=lyx.git diff --git a/src/ConverterCache.cpp b/src/ConverterCache.cpp index c601c3f708..0f4d03efb9 100644 --- a/src/ConverterCache.cpp +++ b/src/ConverterCache.cpp @@ -25,8 +25,8 @@ #include "support/lyxtime.h" #include "support/Package.h" +#include "support/checksum.h" #include "support/lassert.h" -#include #include #include @@ -41,14 +41,6 @@ namespace lyx { namespace { -unsigned long do_crc(string const & s) -{ - boost::crc_32_type crc; - crc = for_each(s.begin(), s.end(), crc); - return crc.checksum(); -} - - // FIXME THREAD // This should be OK because it is only assigned during init() static FileName cache_dir; @@ -62,7 +54,8 @@ public: : timestamp(t), checksum(c) { ostringstream os; - os << setw(10) << setfill('0') << do_crc(orig_from.absFileName()) + os << setw(10) << setfill('0') + << support::checksum(orig_from.absFileName()) << '-' << to_format; cache_name = FileName(addName(cache_dir.absFileName(), os.str())); LYXERR(Debug::FILES, "Add file cache item " << orig_from @@ -244,6 +237,8 @@ void ConverterCache::init() cache_dir = FileName(addName(package().user_support().absFileName(), "cache")); if (!cache_dir.exists()) if (!cache_dir.createDirectory(0700)) { + // FIXME This should really be displayed as a message. But the GUI + // does not exist yet. lyxerr << "Could not create cache directory `" << cache_dir << "'." << endl; exit(EXIT_FAILURE);