Hi all,

I was testing the persistence system again, but on MITK 2016.03 this time. I did fall on all the same traps so this old conversation helped me. I have some new questions though.

Right now, the persistence system simply creates PersistentData.xml in AppData/.../#_MitkPersistence, with '#' starting at 45 and going up.

 * The first file (45) is never used after. It's never found by MITK.
   On the second run, it creates '46' and the data are read on all the
   next runs. But the real problem comes next.
 * Why? I don't understand the point of saving a xml file in AppData.
   Isn't this a new QSettings? I thought the data was going to be saved
   in the scene.

In fact, I searched in your code using 'git grep' and I can't find where PersistenceService is used when saving a scene. I can see it is used in PersistenceService::Save() and PersistenceService::Load() when a filename is passed, but afaik it never happens. GetDataNodes() could be called by the scene-saving code but it's not. Knowing all this, I'm less surprised that BeforePropertyListReplaced() was never called!

Can someone please confirm that the persistence system is working when saving and loading a scene? And if it does, can you please tell me how!?! Where in SceneSerialization does it happens?
Thank you for your time.

Nil

Le 2016-04-06 à 12:22, Nil Goyette a écrit :
Ah, thank you, mitk::PersistenceService::LoadModule() was the missing
piece of information.

The service is not a nullptr anymore and I can get the properties
associated with an ID and they are kept during the lifetime of the
application.

So, I added the call to AddPropertyListReplacedObserver(this) but
BeforePropertyListReplaced() and AfterPropertyListReplaced() are never
called. I thought they would be called when the user saves and load a scene.
Did I miss something?

Le 2016-04-06 05:49, Kolb, Christoph a écrit :
I have just tested the PersistenceService in a Plugin and got the same error 
message:
"The calling module probably misses a US_MODULE_NAME compile definition and/or 
a call to
US_INITIALIZE_MODULE in one of its source files."

It worked after I added a dependency to MitkPersistence and
called mitk::PersistenceService::LoadModule() in the constructor of my 
pluginView. I also needed to
put US_INITIALIZE_MODULE in the source.

Regards
Christoph
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to