summaryrefslogtreecommitdiff
path: root/src/openscad.cc
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-01 03:11:29 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-01 03:11:29 (GMT)
commit76f0b1119f1be174ce7adbb1458d2d9a3fa30d22 (patch)
tree0c30a8720e8fd56a6a051ec3a2d2d3f61307b7e1 /src/openscad.cc
parent17eb94bf67ae55fb3f649d99790593907b7820b0 (diff)
bugfix: In MDI mode, the parser must know which file it compiles, not just the contents, for inluded files to be found. Made the parser Qt-dependant - oh well...
git-svn-id: http://svn.clifford.at/openscad/trunk@395 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/openscad.cc')
-rw-r--r--src/openscad.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openscad.cc b/src/openscad.cc
index a86b3c0..f5bf77f 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -181,6 +181,7 @@ int main(int argc, char **argv)
ModuleInstantiation root_inst;
AbstractNode *root_node;
+ QFileInfo fileInfo(filename);
handle_dep(filename);
FILE *fp = fopen(filename, "rt");
if (!fp) {
@@ -195,12 +196,11 @@ int main(int argc, char **argv)
text += buffer;
}
fclose(fp);
- root_module = parse((text+commandline_commands).toAscii().data(), false);
+ root_module = parse((text+commandline_commands).toAscii().data(), fileInfo.absolutePath().toLocal8Bit(), false);
}
QString original_path = QDir::currentPath();
- QFileInfo fileInfo(filename);
- QDir::setCurrent(fileInfo.dir().absolutePath());
+ QDir::setCurrent(fileInfo.absolutePath());
AbstractNode::idx_counter = 1;
root_node = root_module->evaluate(&root_ctx, &root_inst);
contact: Jan Huwald // Impressum