mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
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:
parent
2be54d2a25
commit
2823eed291
@ -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();
|
||||
|
10
src/Format.h
10
src/Format.h
@ -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_;
|
||||
};
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user