-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recreating saved dynprops #174
Conversation
… to a shared function in plugin. This requires giving the plugin class access to some of the (previously) protected properties of its child classes. What is really new (and not jsut moved) in this code is the re-establishing of dynamic properties at load time. Probably because objects that no longer match the current classdef are converted to structs, their dynprops are lost. I now recreate those, and make them read only. This avoids errors in plugin code that relies on the dynprops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me. I don't see any problems here.
So, if I understand this correctly, shouldn't all plugins also include a call to |
if so, could we instead ensure that loadobj() only exists in |
Most plugins don't have (or need) a loadobj() because their definitions haven;t changed. But once a loadobj function becomes necessary that plugin's loadobj should also call updateClassdef() Maybe it is possible to (preemptively) define a loadobj in plugin.m and let that call updateClassDef. That would certainly be cleaner and more future proof. I'll give it a try. But I think the way loadobj is inherited or not by subclasses may complicate this. |
Right you are.. |
Fix a bug that prevents old datafiles from being loaded and used in an analysis due to missing dynamic properties.
Moved the code to update a saved object to the new (current) classdef to a shared function in plugin.
This requires giving the plugin class access to some of the (previously) protected properties of its child classes.
What is really new (and not just moved) in this code is the re-establishing of dynamic properties at load time.
Probably because objects that no longer match the current classdef are converted to structs, their dynprops are lost.
I now recreate those, and make them read-only. This avoids errors in plugin code that relies on the dynprops.