Page MenuHomePhabricator

QmitkDataStorageListModel broken
Closed, ResolvedPublic

Description

When attempting to use QmitkDataStorageListModel (in Modules/QtWidgets) I remarked at least two bugs that rendered the class unusable for me:

  1. handling of node observer tags was implemented in only half of the methods. When changing the node filtering predicate, things would crash because list indices were not well managed.
  1. the class would hold an ITK SmartPointer and "delete" it in its destructor. This, too, does not end well. It crashes.

Since the idea of the class is still useful for certain use cases, I fixed those issues and tried to unify the structure of the class a bit.

Since nothing in MITK is using this class, not even a test, I'll wait for some feedback before integration. Also, I'd like to add at least a minimal unit test. If somebody volunteers on this task, I'll easily let go.

Event Timeline

User maleike has pushed new remote branch:

bug-19571-QmitkDataStorageListModel-fixes

User maleike has pushed new remote branch:

bug-19571-QmitkDataStorageListModel-fixes-only

[8e8443]: Merge branch 'bug-19571-QmitkDataStorageListModel-fixes-only'

Merged commits:

2016-02-19 17:10:22 Daniel Maleike [df9e1f]
Fixing two issues and restructuring QmitkDataStorageListModel

  • avoid "delete itk:SmartPointer<>"
  • handle observer tags in all relevant methods
  • update comments, data structure, some methods

[1aac94]: Merge branch 'bug-19571-QmitkDataStorageListModel-fixes-only'

Merged commits:

2016-02-29 17:28:35 Daniel Maleike [e22b6c]
Add minimal test and fix bug on SetDataStorage(nullptr)

Since there were no objections or mentioned use cases within one week, I go ahead and integrate my changes.

I also committed a minimal test doing just instantiation and setters. To prove good habits, this test was still capable of finding a bug.

I remarked that the observation of data nodes for modified events is not correctly done. In addition, I'd like enhance the observation to include modified events of the base data.

[4bb60b]: Merge branch 'bug-19571-QmitkDataStorageListModel-fixes-only'

Merged commits:

2016-03-01 16:51:58 Daniel Maleike [c42553]
Fix export statement


2016-03-01 16:48:43 Daniel Maleike [d744d7]
Fix node observation and add BaseData ModifiedEvents observation

[0d42dd]: Merge branch 'bug-19571-QmitkDataStorageListModel-fixes-only'

Merged commits:

2016-03-01 17:09:00 Daniel Maleike [26d3f0]
COMP: Fix merge error