Commit c224c7f4 authored by Mike Kremer's avatar Mike Kremer

Default light sources won't be added to ini file anymore when saving settings.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9204 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4203286a
......@@ -61,6 +61,8 @@
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/common/RecentFiles.hh>
#include <ObjectTypes/Light/Light.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <QFile>
......@@ -704,6 +706,14 @@ void Core::writeIniFile(QString _filename,
for ( PluginFunctions::ObjectIterator o_it(restriction) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
QString file = o_it->path() + OpenFlipper::Options::dirSeparator() + o_it->name();
// Don't save default light source objects
LightObject* light = 0;
PluginFunctions::getObject( o_it->id(), light );
if(light != 0) {
if(light->defaultLight()) continue;
}
if (QFile(file).exists()){
// Add a section for this object
sectionName = o_it->name();
......@@ -729,8 +739,16 @@ void Core::writeIniFile(QString _filename,
// Tell plugins to save their information for the given object
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ;
o_it != PluginFunctions::objectsEnd(); ++o_it)
o_it != PluginFunctions::objectsEnd(); ++o_it) {
// Don't save default light source objects
LightObject* light = 0;
PluginFunctions::getObject( o_it->id(), light );
if(light != 0) {
if(light->defaultLight()) continue;
}
emit iniSave( ini , o_it->id() );
}
}
......
......@@ -45,6 +45,8 @@
#include "OpenFlipper/common/GlobalOptions.hh"
#include <ObjectTypes/Light/Light.hh>
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
#include "OpenFlipper/widgets/loadWidget/loadWidget.hh"
......@@ -210,6 +212,13 @@ void Core::saveSettings(){
filename += "obj";
}
}
// Don't save default light source objects
LightObject* light = 0;
PluginFunctions::getObject( o_it->id(), light );
if(light != 0) {
if(light->defaultLight()) continue;
}
// decide whether to use saveObject or saveObjectTo
if ( !QFile(filename).exists() || !askOverwrite->isChecked() )
......
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