+ if(mainItemType == "Chat") {
+ fmtType |= UiStyle::BufferViewItem;
+ if(!type.isEmpty()) {
+ if(type == "network")
+ fmtType |= UiStyle::NetworkItem;
+ else if(type == "channel")
+ fmtType |= UiStyle::ChannelBufferItem;
+ else if(type == "query")
+ fmtType |= UiStyle::QueryBufferItem;
+ else {
+ qWarning() << Q_FUNC_INFO << tr("Invalid chatlist item type %1").arg(type);
+ return UiStyle::Invalid;
+ }
+ }
+ if(!state.isEmpty()) {
+ if(state == "inactive")
+ fmtType |= UiStyle::InactiveBuffer;
+ else if(state == "channel-event")
+ fmtType |= UiStyle::ActiveBuffer;
+ else if(state == "unread-message")
+ fmtType |= UiStyle::UnreadBuffer;
+ else if(state == "highlighted")
+ fmtType |= UiStyle::HighlightedBuffer;
+ else if(state == "away")
+ fmtType |= UiStyle::UserAway;
+ else {
+ qWarning() << Q_FUNC_INFO << tr("Invalid chatlist state %1").arg(state);
+ return UiStyle::Invalid;
+ }
+ }
+ } else { // NickList
+ fmtType |= UiStyle::NickViewItem;
+ if(!type.isEmpty()) {
+ if(type == "user") {
+ fmtType |= UiStyle::IrcUserItem;
+ if(state == "away")
+ fmtType |= UiStyle::UserAway;
+ } else if(type == "category")
+ fmtType |= UiStyle::UserCategoryItem;
+ }
+ }
+ return fmtType;
+}
+
+/******** Parse a whole format attribute block ********/
+
+QTextCharFormat QssParser::parseFormat(const QString &qss) {
+ QTextCharFormat format;
+
+ foreach(QString line, qss.split(';', QString::SkipEmptyParts)) {