Bug 318504 - Plasma::ConfigLoader fails to load default value of QColor with alpha channel
Summary: Plasma::ConfigLoader fails to load default value of QColor with alpha channel
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: 4.10.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-17 14:05 UTC by Michał D. (Emdek)
Modified: 2013-05-16 15:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał D. (Emdek) 2013-04-17 14:05:18 UTC
Due to some limitations of QColor constructors Plasma::ConfigLoader fails to load default value of QColor with alpha channel, both specified as: r,g,b,a or #AARRGGBB.
Since QColor seems to be not smart enough to correctly parse its input then it probably should be fixed (at least for 4.x lifetime) on Plasma level (KConfigXT itself may need the same fix / workaround), by checking if value fits pattern \d+,\d+,\d+,\d+ and split it and feed to another constructor. 
It may also check if value starts with '#' and has length of nine characters.

Reproducible: Always

Steps to Reproduce:
1. Set default value of entry of type Color to 0,0,0,50 or #10000000;
2. Load this value to KColorButton that has enabled alpha channel.
Actual Results:  
Button has invalid value (might be a bug in KColorButton too, which shows white on button but black in dialog)

Expected Results:  
Button should show correct value, with proper alpha channel value.
Comment 1 Michał D. (Emdek) 2013-05-16 15:09:29 UTC
Git commit 72db566f4bf40b79aca69a31e3f514bc7c771628 by Michał Dutkiewicz.
Committed on 16/05/2013 at 17:05.
Pushed by mdutkiewicz into branch 'master'.

Allow Plasma::ConfigLoader to load default QColor values that contain alpha channel

REVIEW: 110427

M  +11   -1    plasma/configloader.cpp
M  +7    -0    plasma/tests/configloadertest.cpp
M  +1    -0    plasma/tests/configloadertest.h
M  +3    -0    plasma/tests/configloadertest.xml

http://commits.kde.org/kdelibs/72db566f4bf40b79aca69a31e3f514bc7c771628