]> git.lyx.org Git - features.git/commitdiff
Moving the zipped file info cache to Formats.cpp saves the inclusion of <map> and...
authorTommaso Cucinotta <tommaso@lyx.org>
Mon, 19 Sep 2011 10:08:33 +0000 (10:08 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Mon, 19 Sep 2011 10:08:33 +0000 (10:08 +0000)
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
src/Format.h

index 22ee7ee0142af74705bf29b1a2b1733cd534fffc..13c8cfff7a1dec6e87ad5037da9e553ce269b715 100644 (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();
index 21721fa8e6c10cfcfb1a480b5aaf1c11bbfb06f6..335b484a552b48457a43f94975a86f82a6c03872 100644 (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_;
 };
 
 ///