+ foreach(QString line, contents.split(';', QString::SkipEmptyParts)) {
+ int idx = line.indexOf(':');
+ if(idx <= 0) {
+ qWarning() << Q_FUNC_INFO << tr("Invalid property declaration: %1").arg(line.trimmed());
+ continue;
+ }
+ QString property = line.left(idx).trimmed();
+ QString value = line.mid(idx + 1).trimmed();
+
+ if(property == "background" || property == "background-color")
+ format.setBackground(parseBrushValue(value));
+ else if(property == "foreground" || property == "color")
+ format.setForeground(parseBrushValue(value));
+
+ else {
+ qWarning() << Q_FUNC_INFO << tr("Unknown ChatLine property: %1").arg(property);
+ }
+ }
+
+ _formats[fmtType] = format;