diff options
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 955921d..af220a3 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1313,13 +1313,18 @@ void MainWindow::actionExportSTLorOFF(bool) pd->show(); QApplication::processEvents(); - if (stl_mode) - export_stl(this->root_N, stl_filename, pd); - else - export_off(this->root_N, stl_filename, pd); - - PRINTF("%s export finished.", stl_mode ? "STL" : "OFF"); + QFile file(filename); + if (!file.open(QIODevice::ReadWrite)) { + PRINTA("Can't open file \"%1\" for export", filename); + } + else { + QTextStream fstream(&file); + if (stl_mode) export_stl(this->root_N, fstream, pd); + else export_off(this->root_N, fstream, pd); + file.close() + PRINTF("%s export finished.", stl_mode ? "STL" : "OFF"); + } delete pd; clearCurrentOutput(); |