Page MenuHomePhabricator

ChangeRequest.txt

Authored By
schwarzt
Oct 15 2009, 12:01 PM
Size
1 KB
Referenced Files
None
Subscribers
None

ChangeRequest.txt

Summary of bug description
* Actual behaviour: Global Interaction, its states and event mapping, are initialized via an XML file,
which has to be located in the binary directory when using an MITK installer
* Expected behaviour: The XML file should be compiled into the binary as a Qt Resource and be loaded from there
Cause of the bug
By now, the (singleton) Global Interaction is initialized by calling the GetInstance() method the first time, whith given parameters;
This is against the logic of singleton classes, GetInstance() should not take parameters or be used for initialization.
But, GlobalInteraction cannot read out a Qt resource, because it is not Qt related and has no access to Qmitk.
Proposed solution
Creation of an Activator class in mitk.gui.qt.common, which reads out the XML string from the Qt resource and creates an instance of Globalinteraction.
Also, GlobalInteraction is provided a Initialize method, which takes the start state and XML string as input and must be called once and only once.
In this method, the StateMachineFactory and EventMapper are created and initialized from the XML string.
Also, the start state is set here, because it was not given at time of creation;
Additionally, StateMachineFactory and EventMapper are now Members of GlobalInteraction, so they don't need to be static anymore;
Affected classes
QmitkGlobalInteraction.h and .cpp
QmitkStateMachineFactory.h and .cpp
QmitkEventMapper.h and .cpp
QmitkStateMachineActivator.h and .cpp (New files)
How will the bugfix get tested?
Automatic in mitkGlobalInteractionTest.cpp, mitkStateMachineFactoryTest.cpp

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
282
Default Alt Text
ChangeRequest.txt (1 KB)