chatline: highlightcolor is only loaded once in the init
authorAlexander von Renteln <phon@quassel-irc.org>
Tue, 15 Apr 2008 14:57:26 +0000 (14:57 +0000)
committerAlexander von Renteln <phon@quassel-irc.org>
Tue, 15 Apr 2008 14:57:26 +0000 (14:57 +0000)
userinputhandler: removed a qdebug, i forgot to remove

src/core/userinputhandler.cpp
src/qtui/chatline-old.cpp
src/qtui/chatline-old.h

index 618bc8d..0ef5aba 100644 (file)
@@ -92,7 +92,6 @@ void UserInputHandler::handleBan(const BufferInfo &bufferInfo, const QString &ms
   }
 
   QString banMsg = QString("MODE %1 +b %2").arg(banChannel).arg(banUser);
   }
 
   QString banMsg = QString("MODE %1 +b %2").arg(banChannel).arg(banUser);
-  qDebug() << banMsg;
   emit putRawLine(serverEncode(banMsg));
 }
 
   emit putRawLine(serverEncode(banMsg));
 }
 
index c1cd7d2..2df6bbb 100644 (file)
@@ -36,6 +36,9 @@ ChatLineOld::ChatLineOld(Message m) {
   selectionMode = None;
   isHighlight = false;
   formatMsg(msg);
   selectionMode = None;
   isHighlight = false;
   formatMsg(msg);
+
+  QtUiSettings s("QtUi/Colors");
+  _highlightColor = s.value("highlightColor", QVariant(QColor("lightcoral"))).value<QColor>();
 }
 
 ChatLineOld::~ChatLineOld() {
 }
 
 ChatLineOld::~ChatLineOld() {
@@ -318,10 +321,8 @@ void ChatLineOld::draw(QPainter *p, const QPointF &pos) {
     p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height())));
   } else {
     if(isHighlight) {
     p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height())));
   } else {
     if(isHighlight) {
-      QtUiSettings s("QtUi/Colors");
-      QColor highlightColor = s.value("highlightColor", QVariant(QColor("lightcoral"))).value<QColor>();
       p->setPen(Qt::NoPen);
       p->setPen(Qt::NoPen);
-      p->setBrush(highlightColor /*pal.brush(QPalette::AlternateBase) */);
+      p->setBrush(_highlightColor /*pal.brush(QPalette::AlternateBase) */);
       p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height())));
     }
     if(selectionMode == Partial) {
       p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height())));
     }
     if(selectionMode == Partial) {
index 8d286b0..f4877a9 100644 (file)
@@ -106,6 +106,8 @@ class ChatLineOld : public QObject, public AbstractUiMsg {
     void precomputeLine();
     QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &);
     QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &, const QTextLayout::FormatRange &additional);
     void precomputeLine();
     QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &);
     QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &, const QTextLayout::FormatRange &additional);
+
+    QColor _highlightColor;
 };
 
 #endif
 };
 
 #endif