Fix QSS syntax
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 24 Aug 2009 19:18:27 +0000 (21:18 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 24 Aug 2009 19:18:27 +0000 (21:18 +0200)
We want #netsplit-join rather than #netsplitJoin, and #netsplit-quit
rather than #netsplitQuit.

data/default.qss
src/qtui/qtuistyle.cpp
src/uisupport/qssparser.cpp

index eb7f76a..b2e4747 100644 (file)
@@ -88,8 +88,8 @@ ChatLine#info { foreground: #916409; }
 ChatLine#error { foreground: #916409; }
 ChatLine#daychange { foreground: #916409; }
 ChatLine#topic { foreground: #960096; }
-ChatLine#netsplitJoin { foreground: #960096; }
-ChatLine#netsplitQuit { foreground: #960096; }
+ChatLine#netsplit-join { foreground: #960096; }
+ChatLine#netsplit-quit { foreground: #960096; }
 
 // BufferView Colors
 ChatListItem[state="inactive"] { foreground: #a0a0a4; }
index 84b1d14..396fb9a 100644 (file)
@@ -82,8 +82,8 @@ void QtUiStyle::generateSettingsQss() const {
         << msgTypeQss("error", "ErrorMsg", s)
         << msgTypeQss("daychange", "ServerMsg", s)
         << msgTypeQss("topic", "CommandMsg", s)
-        << msgTypeQss("netsplitJoin", "CommandMsg", s)
-        << msgTypeQss("netsplitQuit", "CommandMsg", s)
+        << msgTypeQss("netsplit-join", "CommandMsg", s)
+        << msgTypeQss("netsplit-quit", "CommandMsg", s)
         << "\n";
   }
 
index ceac60b..56a7612 100644 (file)
@@ -160,7 +160,7 @@ void QssParser::parsePaletteBlock(const QString &decl, const QString &contents)
 /******** Determine format types from a block declaration ********/
 
 quint64 QssParser::parseFormatType(const QString &decl) {
-  QRegExp rx("ChatLine(?:::(\\w+))?(?:#(\\w+))?(?:\\[([=-,\\\"\\w\\s]+)\\])?");
+  QRegExp rx("ChatLine(?:::(\\w+))?(?:#([\\w\\-]+))?(?:\\[([=-,\\\"\\w\\s]+)\\])?");
   // $1: subelement; $2: msgtype; $3: conditionals
   if(!rx.exactMatch(decl)) {
     qWarning() << Q_FUNC_INFO << tr("Invalid block declaration: %1").arg(decl);
@@ -226,9 +226,9 @@ quint64 QssParser::parseFormatType(const QString &decl) {
       fmtType |= UiStyle::DayChangeMsg;
     else if(msgType == "topic")
       fmtType |= UiStyle::TopicMsg;
-    else if(msgType == "netsplitJoin")
+    else if(msgType == "netsplit-join")
       fmtType |= UiStyle::NetsplitJoinMsg;
-    else if(msgType == "netsplitQuit")
+    else if(msgType == "netsplit-quit")
       fmtType |= UiStyle::NetsplitQuitMsg;
     else {
       qWarning() << Q_FUNC_INFO << tr("Invalid message type in %1").arg(decl);