From 2823eed291267ee7f49272ebadbdc190eeaf8580 Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Mon, 19 Sep 2011 10:08:33 +0000 Subject: [PATCH] Moving the zipped file info cache to Formats.cpp saves the inclusion of and 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 --- src/Format.cpp | 15 +++++++++++++++ src/Format.h | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Format.cpp b/src/Format.cpp index 22ee7ee014..13c8cfff7a 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -29,6 +29,8 @@ #include "support/Translator.h" #include +#include +#include // 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 zipped_; + + bool Formats::isZippedFile(support::FileName const & filename) const { string const & fname = filename.absFileName(); time_t timestamp = filename.lastModified(); diff --git a/src/Format.h b/src/Format.h index 21721fa8e6..335b484a55 100644 --- a/src/Format.h +++ b/src/Format.h @@ -17,8 +17,6 @@ #include "OutputParams.h" #include -#include -#include 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 zipped_; }; /// -- 2.39.2