mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdeui: print error message if reading hex QColor from config results in invalid color
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5ca124cb4e
commit
7555229053
1 changed files with 2 additions and 8 deletions
|
@ -49,14 +49,8 @@ static bool readEntryGui(const QByteArray& data, const char* key, const QVariant
|
|||
if (data.isEmpty() || data == "invalid") {
|
||||
output = QColor(); // return what was stored
|
||||
return true;
|
||||
} else if (data.at(0) == '#') {
|
||||
QColor col;
|
||||
col.setNamedColor(QString::fromUtf8(data.constData(), data.length()));
|
||||
output = col;
|
||||
return true;
|
||||
} else if (!data.contains(',')) {
|
||||
QColor col;
|
||||
col.setNamedColor(QString::fromUtf8(data.constData(), data.length()));
|
||||
} else if (data.at(0) == '#' || !data.contains(',')) {
|
||||
QColor col(QString::fromUtf8(data.constData(), data.length()));
|
||||
if (!col.isValid())
|
||||
kError() << qPrintable(errString);
|
||||
output = col;
|
||||
|
|
Loading…
Add table
Reference in a new issue