summaryrefslogtreecommitdiff
path: root/src/linearextrude.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-07-15 01:57:41 (GMT)
committerMarius Kintel <marius@kintel.net>2012-07-15 01:57:41 (GMT)
commit2495df6bab07f14f0eed7062dec17d24599aa838 (patch)
tree738002af91eb84dc98e20b42520745161be0ca29 /src/linearextrude.cc
parent3085bcc65cd80cc70b3b118b89ee5a41e7ef8ceb (diff)
Add timestamp to cache key for modules importing files. Fixes #141
Diffstat (limited to 'src/linearextrude.cc')
-rw-r--r--src/linearextrude.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/linearextrude.cc b/src/linearextrude.cc
index 89098da..4d2730c 100644
--- a/src/linearextrude.cc
+++ b/src/linearextrude.cc
@@ -38,6 +38,9 @@
#include <boost/assign/std/vector.hpp>
using namespace boost::assign; // bring 'operator+=()' into scope
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
class LinearExtrudeModule : public AbstractModule
{
public:
@@ -143,11 +146,17 @@ std::string LinearExtrudeNode::toString() const
stream << this->name() << "(";
if (!this->filename.empty()) { // Ignore deprecated parameters if empty
+ fs::path path(this->filename);
stream <<
"file = " << this->filename << ", "
"layer = " << QuotedString(this->layername) << ", "
"origin = [" << this->origin_x << ", " << this->origin_y << "], "
- "scale = " << this->scale << ", ";
+ "scale = " << this->scale << ", "
+#ifndef OPENSCAD_TESTING
+ // timestamp is needed for caching, but disturbs the test framework
+ << "timestamp = " << (fs::exists(path) ? fs::last_write_time(path) : 0) << ", "
+#endif
+ ;
}
stream <<
"height = " << std::dec << this->height << ", "
contact: Jan Huwald // Impressum