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

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

- change log to the real output file path
- erase redundant setting of the name

refs #670

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14541 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 052ab934
......@@ -106,10 +106,6 @@ int FileSTLPlugin::loadObject(QString _filename) {
object->setFromFileName(_filename);
// call the local function to update names
QFileInfo f(_filename);
object->setName( f.fileName() );
std::string filename = std::string( _filename.toUtf8() );
// load file
......@@ -149,8 +145,7 @@ bool FileSTLPlugin::saveObject(int _id, QString _filename)
if ( object->dataType( DATA_TRIANGLE_MESH ) ) {
object->setName(_filename.section(OpenFlipper::Options::dirSeparator(),-1));
object->setPath(_filename.section(OpenFlipper::Options::dirSeparator(),0,-2) );
object->setFromFileName(_filename);
TriMeshObject* triObj = dynamic_cast<TriMeshObject* >( object );
......@@ -164,10 +159,10 @@ bool FileSTLPlugin::saveObject(int _id, QString _filename)
}
if (OpenMesh::IO::write_mesh(*triObj->mesh(), filename.c_str(), opt) ) {
emit log(LOGINFO, tr("Saved object to ") + object->path() + OpenFlipper::Options::dirSeparator() + object->name() );
emit log(LOGINFO, tr("Saved object to ") + _filename );
return true;
} else {
emit log(LOGERR, tr("Unable to save ") + object->path() + OpenFlipper::Options::dirSeparator() + object->name());
emit log(LOGERR, tr("Unable to save ") + _filename );
return false;
}
} else {
......
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