Page MenuHomePhabricator

ChangeRequest_v2.txt

Authored By
schwarzt
Aug 12 2009, 5:00 PM
Size
2 KB
Referenced Files
None
Subscribers
None

ChangeRequest_v2.txt

Summary of bug description
* Actual behaviour: Show view menu shows bundles in random (unsorted) order
* Expected behaviour: Show view menu shows bundles in fixed (sorted) order
Cause of the bug
By getting all Views from the view registry a vector of IViewDescriptors which are not sorted is returned.
This vector is used to initialize and fill a Qt Menu bar from which the views can be selected inside the application (CoreApp, ExtApp or SandboxApp)
(If you don't know what a View or ViewDescriptor is, please read the BlueBerry documentation)
Proposed solution
Insert elements from the vector one by one into a map like this:
1. The first element ("key") of the map should be the label of the IViewDescriptor;
2. The second element ("value") should be the IViewDescriptor itself;
-> This automatically sorts the elements by name, as maps are sorted by their key.
Now insert the values from the map in ascending order into the QMenu to ensure a sorted order.
Affected classes
QmitkWorkbenchWindowAdvisor.cpp
How will the bugfix get tested?
Brief: Start the application with more then one bundles activated and check whether they are sorted.
Manual test:
1. Start a MITK CoreApp, ExtApp or SandboxApp, which has more then 2 Bundles activated via CMake (see www.CMake.org for a description of how to use Cmake).
(Ask your administrator if you don't know how to start a program).
2. Click on the Menu Option "Show View". This is the second menu icon from the left. Only click once with the left mouse button, do not double click.
3. This should open a list of available bundles. (If you don't know what a bundle is, please read the BlueBerry documentation)
4. In this list, bundles should appear sorted by alphabet from top to bottom, meening the bundle with a name with the lowest starting letter in the alphabet should appear on top.
5. If 4. is fulfilled, the test is successful.
Last tested successfully on 08/12/09.
Comment: The method in which the patch will be committed will be replaced in less then 2 months.

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
263
Default Alt Text
ChangeRequest_v2.txt (2 KB)