Commit a6cf94c0 authored by Jan Möbius's avatar Jan Möbius

Write ObjectTypeName to file rather then its id

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4037 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 489cbfa7
......@@ -492,10 +492,21 @@ void Core::openIniFile(QString _filename) {
int tmpType;
DataType type = DATA_TRIANGLE_MESH;
int tmpTypeId=0;
if ( ini.get_entry( tmpType, sectionName , "type" )) {
type = DataType(tmpType);
} else
emit log(LOGWARN, "Unable to get DataType for object " + sectionName + " assuming Triangle Mesh" );
} else {
std::cerr << "Unable to get an integer from the type field!" << std::endl;
std::cerr << "Assuming new inifile version" << std::endl;
QString typeName="";
if ( ini.get_entry( typeName, sectionName , "type" )) {
type = typeId(typeName);
} else
emit log(LOGWARN, "Unable to get DataType for object " + sectionName + " assuming Triangle Mesh" );
}
int newObjectId = loadObject(type, path);
......@@ -583,7 +594,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths, bool _targetOnly
}
// Add the path of this object to the section
ini.add_entry( sectionName , "path" , file );
ini.add_entry( sectionName , "type" , o_it->dataType() );
ini.add_entry( sectionName , "type" , typeName(o_it->dataType() ) );
ini.add_entry( sectionName , "target" , o_it->target() );
ini.add_entry( sectionName , "source" , o_it->source() );
......
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