messagelist: Fix default aggregation and theme inconstancy
ClosedPublic

Authored by aleksejshilin on Feb 9 2018, 9:13 PM.

Details

Summary

When no default aggregation or theme is selected by user, Core::Manager
picks the first one. The available ones were stored in QHash containers
which, per Qt documentation, are ordered randomly:

When iterating over a QMap, the items are always sorted by key. With
QHash, the items are arbitrarily ordered.

Given that keys are generated in a way that they differ each time, the
result of picking the first item was unpredictable.

This commit changes containers' type to QMap which guarantees order.

Diff Detail

Repository
R94 PIM: Message Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aleksejshilin created this revision.Feb 9 2018, 9:13 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptFeb 9 2018, 9:13 PM
aleksejshilin requested review of this revision.Feb 9 2018, 9:13 PM
mlaurent accepted this revision.Feb 10 2018, 8:11 PM
mlaurent added a subscriber: mlaurent.

Seems logical.
Thanks

This revision is now accepted and ready to land.Feb 10 2018, 8:11 PM

Thanks!
Please note that I don't have a Developer Account and hence am unable to push the changes myself.

I will commit this afternoon for you :)
I need to leave soon.

Regards

This revision was automatically updated to reflect the committed changes.