Page MenuHomePhabricator

No notification on ColorProperty change
Closed, InvalidPublic

Description

We use the callback system a lot in our program and everything work wel except for the ColorProperty. I investigated and found that Modified is never called when we modify the ColorProperty.

PR: https://github.com/MITK/MITK/pull/192

Event Timeline

goch added a subscriber: goch.

This should not be necessary, as there already is a Modified that is called:

void mitk::LookupTableProperty::SetLookupTable(const mitk::LookupTable::Pointer aLookupTable)
{
  if ((m_LookupTable != aLookupTable) || (*m_LookupTable != *aLookupTable))
  {
    m_LookupTable = aLookupTable;
    Modified();
  }
}

I agree that there's a Modified() in LookupTableProperty but the bug is related to ColorProperty. You know your code base much more than me so maybe these properties are super related and I'm not aware of it but... why is LookupTableProperty relevant?

Also, even if they are indeed related, the fact remain that the callbacks are not called on "color" change.

Erm, I was mostly looking at the pull request you linked and that one just adds an unneeded line in

void mitk::LookupTableProperty::SetValue(const ValueType &value)

I am going to reopen the task, but you might want to check the pull request.

Haha, oups, as you can see, I didn't actually remember what I did :)

Humm, I know my patch does fix the bug but you know it's useless. I'll investigate more and keep you updated. Maybe there's a better place for this update.

You are totally right, this PR can't change anything because there's already a Modified() called just before. Furthermore, I can't even reproduce my own bug! My callbacks are now called as they should. I'm not sure what happened :| I'll convince myself that something related changed in MITK 2016.11 but I doubt it ^^

I'll leave with a "My bad. Sorry." and close this task :) Thank you for your time.