diff options
author | meta <s@w23.at> | 2011-01-17 23:20:12 (GMT) |
---|---|---|
committer | meta <s@w23.at> | 2011-01-17 23:20:12 (GMT) |
commit | e01934a24da408ac28076cc151e00c17ad6172ee (patch) | |
tree | 1c941b32debd598257f1c19c4cec92c2ea2f3eea /src/dxfrotextrude.cc | |
parent | 8160212499c40c74f1c1c396f02332336ec4e8ae (diff) |
use QFileInfo instead of stat()
Diffstat (limited to 'src/dxfrotextrude.cc')
-rw-r--r-- | src/dxfrotextrude.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/dxfrotextrude.cc b/src/dxfrotextrude.cc index ea603f0..6344d2a 100644 --- a/src/dxfrotextrude.cc +++ b/src/dxfrotextrude.cc @@ -33,13 +33,11 @@ #include "progress.h" #include "openscad.h" // get_fragments_from_r() -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - #include <QTime> #include <QApplication> #include <QProgressDialog> +#include <QDateTime> +#include <QFileInfo> class DxfRotateExtrudeModule : public AbstractModule { @@ -217,15 +215,13 @@ QString DxfRotateExtrudeNode::dump(QString indent) const { if (dump_cache.isEmpty()) { QString text; - struct stat st; - memset(&st, 0, sizeof(struct stat)); - stat(filename.toAscii().data(), &st); + QFileInfo fileInfo(filename); text.sprintf("rotate_extrude(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", " "origin = [ %g %g ], scale = %g, convexity = %d, " "$fn = %g, $fa = %g, $fs = %g) {\n", - filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, - layername.toAscii().data(), origin_x, origin_y, scale, convexity, - fn, fa, fs); + filename.toAscii().data(), (int)fileInfo.lastModified().toTime_t(), + (int)fileInfo.size(),layername.toAscii().data(), origin_x, origin_y, + scale, convexity, fn, fa, fs); foreach (AbstractNode *v, children) text += v->dump(indent + QString("\t")); text += indent + "}\n"; |