Bug 446631

Summary: Brush settings model sorts options by insertion instead of by category
Product: [Applications] krita Reporter: amyspark <amy>
Component: Brush enginesAssignee: amyspark <amy>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.0.0-beta5   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Page 1 of the MyPaint settings widget
Page 2 of the MyPaint settings widget

Description amyspark 2021-12-07 17:06:54 UTC
Created attachment 144312 [details]
Page 1 of the MyPaint settings widget

SUMMARY

KisPaintOpOptionListModel renders paintop options as they were inserted. This usually matches the category order, but this parameter is pointless; categories are created as standalone items. This results in a particular setting of MyPaint brushes, "Airbrush", being rendered as part of the "Custom" category when it's a "Color" option.

STEPS TO REPRODUCE
1.  Open Krita.
2.  Select a MyPaint brush.
3.  Check its options list. Cross check it with the category specified in MyPaintPaintOpSettingsWidget.cpp.

OBSERVED RESULT
Items are rendered sorted by insertion order, and categories are rendered at the index they were first created.

EXPECTED RESULT
Items are rendered sorted by category.

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

ADDITIONAL INFORMATION
Comment 1 amyspark 2021-12-07 17:07:19 UTC
Created attachment 144313 [details]
Page 2 of the MyPaint settings widget
Comment 2 Bug Janitor Service 2021-12-07 18:20:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1209
Comment 3 amyspark 2021-12-07 21:50:59 UTC
Git commit f713b89c5168b7f9cd15254734cde18928d4235e by L. E. Segovia.
Committed on 07/12/2021 at 18:17.
Pushed by lsegovia into branch 'master'.

Workaround KisPaintOpOptionListModel sorting "bug"

M  +1    -1    plugins/paintops/mypaint/MyPaintPaintOpSettingsWidget.cpp

https://invent.kde.org/graphics/krita/commit/f713b89c5168b7f9cd15254734cde18928d4235e
Comment 4 amyspark 2021-12-09 22:02:21 UTC
Git commit 916796b9fe1cf4d797da78b8dfea1dda393e474f by L. E. Segovia.
Committed on 09/12/2021 at 22:01.
Pushed by lsegovia into branch 'krita/5.0'.

Workaround KisPaintOpOptionListModel sorting "bug"
(cherry picked from commit f713b89c5168b7f9cd15254734cde18928d4235e)

M  +1    -1    plugins/paintops/mypaint/MyPaintPaintOpSettingsWidget.cpp

https://invent.kde.org/graphics/krita/commit/916796b9fe1cf4d797da78b8dfea1dda393e474f