Commit 4d08bdc4 authored by Jan Möbius's avatar Jan Möbius

Updated open functions to support successfully opened 0 Object ( successfull...

Updated open functions to support successfully opened 0 Object ( successfull file opened but no object created)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7662 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7da7f91c
......@@ -326,14 +326,26 @@ void Core::slotLoad(QString _filename, int _pluginID) {
coreWidget_->setStatus(ApplicationStatus::READY );
}
// Initialize as unknown type
DataType type = DATA_UNKNOWN;
// An object has been added. Get it and do some processing!
if ( id > 0 ) {
/// \todo Move this code to polymesh plugin and do the check there!
BaseObjectData* object;
PluginFunctions::getObject(id,object);
DataType type = object->dataType();
if ( !object ) {
emit log(LOGERR,tr("Object id returned but no object with this id has been found! Error in one of the file plugins!"));
return;
}
// Get the objects type
type = object->dataType();
// Check if it is a polymesh
if ( object != 0 && type == DATA_POLY_MESH ) {
/// \todo Move this code to polymesh plugin and do the check there!
PolyMeshObject* poly = 0;
PluginFunctions::getObject(id,poly);
......@@ -375,6 +387,9 @@ void Core::slotLoad(QString _filename, int _pluginID) {
}
}
}
// If the id was greater than zero, add the file to the recent files.
if ( id >= 0 )
if ( OpenFlipper::Options::gui() )
coreWidget_->addRecent(_filename, type);
......
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