diff options
author | Marius Kintel <marius@kintel.net> | 2012-07-15 01:57:41 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-07-15 01:57:41 (GMT) |
commit | 2495df6bab07f14f0eed7062dec17d24599aa838 (patch) | |
tree | 738002af91eb84dc98e20b42520745161be0ca29 /src/import.cc | |
parent | 3085bcc65cd80cc70b3b118b89ee5a41e7ef8ceb (diff) |
Add timestamp to cache key for modules importing files. Fixes #141
Diffstat (limited to 'src/import.cc')
-rw-r--r-- | src/import.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/import.cc b/src/import.cc index 221ee55..9d011b0 100644 --- a/src/import.cc +++ b/src/import.cc @@ -237,6 +237,7 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const std::string ImportNode::toString() const { std::stringstream stream; + fs::path path(this->filename); stream << this->name(); stream << "(file = " << this->filename << ", " @@ -244,7 +245,13 @@ std::string ImportNode::toString() const "origin = [" << std::dec << this->origin_x << ", " << this->origin_y << "], " "scale = " << this->scale << ", " "convexity = " << this->convexity << ", " - "$fn = " << this->fn << ", $fa = " << this->fa << ", $fs = " << this->fs << ")"; + "$fn = " << this->fn << ", $fa = " << this->fa << ", $fs = " << this->fs +#ifndef OPENSCAD_TESTING + // timestamp is needed for caching, but disturbs the test framework + << ", " "timestamp = " << (fs::exists(path) ? fs::last_write_time(path) : 0) +#endif + << ")"; + return stream.str(); } |