Bug 317905 - Adding entries from data sources mixes allowed values for fields
Summary: Adding entries from data sources mixes allowed values for fields
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 2.3.7
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-05 23:59 UTC by Robby Stephenson
Modified: 2013-04-06 00:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.3.8


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robby Stephenson 2013-04-05 23:59:01 UTC
http://forum.kde.org/viewtopic.php?f=200&t=110654&sid=2fd5be67c37c5ffaa318386fb5323ec7

For Choice fields with allowed values, adding entries from data sources will reset the allowed values to include all default values and not retain ordering.

Reproducible: Always
Comment 1 Robby Stephenson 2013-04-06 00:04:56 UTC
Git commit becfff9e6fca7862ca40e5254697867962c0368c by Robby Stephenson.
Committed on 06/04/2013 at 02:00.
Pushed by rstephenson into branch '2.3'.

Don't reset the list of allowed values when adding new entries

Adding entries from data sources called Kernel:mergeFields() which
used a QSet to merge allowed values. The result is that all the default
values are always added back, and the ordering is not retained.

Move Kernel::mergeFields to Document::mergeFields and retain the
existing list of allowed values, appending new values _if necessary_.

Add a unit test.
FIXED-IN: 2.3.8

M  +4    -0    ChangeLog
M  +1    -1    src/commands/updateentries.cpp
M  +43   -0    src/document.cpp
M  +5    -0    src/document.h
M  +1    -34   src/tellico_kernel.cpp
M  +0    -6    src/tellico_kernel.h
M  +33   -0    src/tests/collectiontest.cpp
M  +1    -0    src/tests/collectiontest.h

http://commits.kde.org/tellico/becfff9e6fca7862ca40e5254697867962c0368c