Commit 93742953 authored by Matthias Möller's avatar Matthias Möller
Browse files

- use function "BaseObject::setFromFilename" instead of using methods seperated

- add error message if file saving fails

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14537 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 141ab9e9
......@@ -234,17 +234,15 @@ bool FileOpenVolumeMeshPlugin::saveObject(int _id, QString _filename) {
HexahedralMeshObject* hex_mesh_obj = PluginFunctions::hexahedralMeshObject(obj);
if (mesh_obj) {
obj->setName(_filename.section(OpenFlipper::Options::dirSeparator(), -1));
obj->setPath(_filename.section(OpenFlipper::Options::dirSeparator(), 0, -2));
fileManager_.writeFile(_filename.toStdString(), *(mesh_obj->mesh()));
obj->setFromFileName(_filename);
if(!fileManager_.writeFile(_filename.toStdString(), *(mesh_obj->mesh())))
emit log(LOGERR, tr("Unable to save ") + _filename);
}
else if (hex_mesh_obj) {
obj->setName(_filename.section(OpenFlipper::Options::dirSeparator(), -1));
obj->setPath(_filename.section(OpenFlipper::Options::dirSeparator(), 0, -2));
fileManager_.writeFile(_filename.toStdString(), *(hex_mesh_obj->mesh()));
obj->setFromFileName(_filename);
if (!fileManager_.writeFile(_filename.toStdString(), *(hex_mesh_obj->mesh())))
emit log(LOGERR, tr("Unable to save ") + _filename);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment