101 } |
103 } |
102 |
104 |
103 QString * HWChatWidget::s_styleSheet = NULL; |
105 QString * HWChatWidget::s_styleSheet = NULL; |
104 QStringList * HWChatWidget::s_displayNone = NULL; |
106 QStringList * HWChatWidget::s_displayNone = NULL; |
105 bool HWChatWidget::s_isTimeStamped = true; |
107 bool HWChatWidget::s_isTimeStamped = true; |
|
108 QString HWChatWidget::s_tsFormat = ":mm:ss"; |
106 |
109 |
107 const QString & HWChatWidget::styleSheet() |
110 const QString & HWChatWidget::styleSheet() |
108 { |
111 { |
109 if (s_styleSheet != NULL) |
112 if (s_styleSheet != NULL) |
110 return *s_styleSheet; |
113 return *s_styleSheet; |
171 // matches class names that are referenced without hierachy |
174 // matches class names that are referenced without hierachy |
172 QRegExp nohierarchy("^.[^ .]+$"); |
175 QRegExp nohierarchy("^.[^ .]+$"); |
173 |
176 |
174 QStringList victims = QString(style). |
177 QStringList victims = QString(style). |
175 remove(displayed). // remove visible stuff |
178 remove(displayed). // remove visible stuff |
|
179 trimmed(). |
176 split(split). // get a list of the names |
180 split(split). // get a list of the names |
177 filter(nohierarchy). // only direct class names |
181 filter(nohierarchy). // only direct class names |
178 replaceInStrings(QRegExp("^."),""); // crop . |
182 replaceInStrings(QRegExp("^."),""); // crop . |
179 |
183 |
180 |
184 |
181 if (victims.contains("timestamp")) |
185 if (victims.contains("timestamp")) |
182 { |
186 { |
183 s_isTimeStamped = false; |
187 s_isTimeStamped = false; |
184 victims.removeAll("timestamp"); |
188 victims.removeAll("timestamp"); |
185 } |
189 } |
|
190 else |
|
191 { |
|
192 s_isTimeStamped = true; |
|
193 s_tsFormat = |
|
194 ((victims.contains("timestamp:hours"))?"":"hh") + |
|
195 QString(":mm:") + |
|
196 ((victims.contains("timestamp:seconds"))?"":"ss"); |
|
197 } |
|
198 |
|
199 victims.removeAll("timestamp:hours"); |
|
200 victims.removeAll("timestamp:seconds"); |
186 |
201 |
187 victims.removeDuplicates(); |
202 victims.removeDuplicates(); |
188 |
203 |
189 QStringList * oldDisplayNone = s_displayNone; |
204 QStringList * oldDisplayNone = s_displayNone; |
190 QString * oldStyleSheet = s_styleSheet; |
205 QString * oldStyleSheet = s_styleSheet; |