Fix adding langs more than once within the same session.

Authored by hein on May 24 2018, 8:22 PM.



[some other text goes here so that the keyword will work; it can't be on the first line]

BUG: 394455

Diff Detail

R119 Plasma Desktop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.May 24 2018, 8:22 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 24 2018, 8:22 PM
hein requested review of this revision.May 24 2018, 8:22 PM
ngraham edited the summary of this revision. (Show Details)May 24 2018, 8:26 PM
davidedmundson added inline comments.May 24 2018, 8:30 PM

Is there now a risk of adding duplicates in kcm.translationsModel.selectedLanguages?

Is this a problem?

hein added a comment.May 24 2018, 8:33 PM

There's no more risk than before. Both versions of the code add two lists together, the other one just ran into Qt Quick type bullshit where one list got serialized to a string.

In terms of what the risk of dupes is: There's one base model with a data role for "is this selected or not" and two filter models which filter this base model based on this data role, in opposite ways. The list in the add dialog is therefore guaranteed not to contain anything that's already selected.

davidedmundson accepted this revision.May 24 2018, 8:55 PM
This revision is now accepted and ready to land.May 24 2018, 8:55 PM
This revision was automatically updated to reflect the committed changes.