- if (!mover.copy(converted_file, item->cache_name, 0600))
- LYXERR(Debug::FILES) << "ConverterCache::add("
- << orig_from << "):\n"
- "Could not copy file."
- << std::endl;
+ // Maybe the contents is still the same?
+ item->timestamp = timestamp;
+ unsigned long const checksum = orig_from.checksum();
+ if (checksum == item->checksum) {
+ LYXERR(Debug::FILES, "Same checksum.");
+ return;
+ }
+ item->checksum = checksum;
+ 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)) {
+ LYXERR(Debug::FILES, "Could not change file mode"
+ << item->cache_name);
+ }