Moving the zipped file info cache to Formats.cpp saves the inclusion of <map> and <ctime> from Format.h

They were implementation-specific and do not impact on the interface anyway.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39709 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2011-09-19 10:08:33 +00:00
parent 2be54d2a25
commit 2823eed291
2 changed files with 15 additions and 10 deletions

View File

@ -29,6 +29,8 @@
#include "support/Translator.h"
#include <algorithm>
#include <map>
#include <ctime>
// FIXME: Q_WS_MACX is not available, it's in Qt
#ifdef USE_MACOSX_PACKAGING
@ -189,6 +191,19 @@ string Formats::getFormatFromExtension(string const & ext) const
}
/// Used to store last timestamp of file and whether it is (was) zipped
struct ZippedInfo {
bool zipped;
std::time_t timestamp;
ZippedInfo(bool zipped, std::time_t timestamp)
: zipped(zipped), timestamp(timestamp) { }
};
/// Mapping absolute pathnames of files to their ZippedInfo metadata.
static std::map<std::string, ZippedInfo> zipped_;
bool Formats::isZippedFile(support::FileName const & filename) const {
string const & fname = filename.absFileName();
time_t timestamp = filename.lastModified();

View File

@ -17,8 +17,6 @@
#include "OutputParams.h"
#include <vector>
#include <map>
#include <ctime>
namespace lyx {
@ -191,14 +189,6 @@ public:
private:
///
FormatList formatlist;
/// Used to store last timestamp of file and whether it is (was) zipped
struct ZippedInfo {
bool zipped; std::time_t timestamp;
ZippedInfo(bool zipped, std::time_t timestamp)
: zipped(zipped), timestamp(timestamp) { }
};
///
mutable std::map<std::string, ZippedInfo> zipped_;
};
///