Bug 423979

Summary: Using the annotation dialog, one can add arbitrary tags to special categories
Product: [Applications] kphotoalbum Reporter: Johannes Zarl-Zierl <johannes>
Component: Annotation DialogAssignee: KPhotoAlbum Bugs <kphotoalbum-bugs-null>
Status: RESOLVED FIXED    
Severity: minor    
Priority: NOR    
Version First Reported In: 5.6.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Johannes Zarl-Zierl 2020-07-07 21:24:26 UTC
SUMMARY
When investigating bug #423978, I realized that one can simply add any tag name to the tokens category.

STEPS TO REPRODUCE
1. Open the annotation dialog for an image
2. Make sure that the Tokens category is visible
3. Add tag "test" to the Tokens category

OBSERVED RESULT
The tag "test" is added to the tokens category.

EXPECTED RESULT
The dialog should prevent the user from adding such a tag because this is bound to cause confusion and because the UI assumes that tokens only ever have values 'a' to 'z'.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Johannes Zarl-Zierl 2020-07-07 21:58:18 UTC
As it turns out, the same is also true for the media type and folder categories, which should be read-only entirely...
Comment 2 Johannes Zarl-Zierl 2020-07-08 22:10:01 UTC
Git commit 68efacfc38c9d27442bcfd4f3ac53340d6f32d1f by Johannes Zarl-Zierl.
Committed on 08/07/2020 at 22:09.
Pushed by johanneszarl into branch 'master'.

ListSelects now can be read-only or selectable-only.

This fixes a long-standing oddity that allowed one to add arbitrary
values to the computed categories "media type" and "folder", as well as
add arbitrary (i.e. non-single-letter) tags to the "tokens" category.

M  +5    -1    AnnotationDialog/CompletableLineEdit.h
M  +40   -10   AnnotationDialog/ListSelect.cpp
M  +23   -2    AnnotationDialog/ListSelect.h
M  +11   -5    AnnotationDialog/enums.h
M  +2    -0    ChangeLog

https://invent.kde.org/graphics/kphotoalbum/commit/68efacfc38c9d27442bcfd4f3ac53340d6f32d1f
Comment 3 Johannes Zarl-Zierl 2020-07-17 00:18:50 UTC
Git commit 810bf443e397c9c86183f853a4256d819d7a6c65 by Johannes Zarl-Zierl.
Committed on 17/07/2020 at 00:16.
Pushed by johanneszarl into branch 'master'.

ListSelect: really prevent read-only items from being changed

Up until now, one could still check items of a read-only category.

M  +7    -1    AnnotationDialog/ListSelect.cpp

https://invent.kde.org/graphics/kphotoalbum/commit/810bf443e397c9c86183f853a4256d819d7a6c65