| 389 | } |
| 390 | |
| 391 | void mitk::PersistenceService::Initialize() |
| 392 | { |
| 393 | if (m_Initialized || m_InInitialized) |
| 394 | return; |
| 395 | m_InInitialized = true; |
| 396 | |
| 397 | m_PropertyListsXmlFileReaderAndWriter = PropertyListsXmlFileReaderAndWriter::New(); |
| 398 | |
| 399 | // Load Default File in any case |
| 400 | this->Load(); |
| 401 | // std::string id = mitk::PersistenceService::PERSISTENCE_PROPERTYLIST_NAME; //see bug 17729 |
| 402 | std::string id = GetPersistencePropertyListName(); |
| 403 | mitk::PropertyList::Pointer propList = this->GetPropertyList(id); |
| 404 | bool autoLoadAndSave = true; |
| 405 | propList->GetBoolProperty("m_AutoLoadAndSave", autoLoadAndSave); |
| 406 | |
| 407 | if (autoLoadAndSave == false) |
| 408 | { |
| 409 | MITK_DEBUG("mitk::PersistenceService") << "autoloading was not wished. clearing data we got so far."; |
| 410 | this->SetAutoLoadAndSave(false); |
| 411 | this->Clear(); |
| 412 | } |
| 413 | |
| 414 | m_InInitialized = false; |
| 415 | m_Initialized = true; |
| 416 | } |
| 417 | |
| 418 | void mitk::PersistenceService::Unitialize() |
| 419 | { |