diff options
Diffstat (limited to 'ksirc/alistbox.cpp')
-rw-r--r-- | ksirc/alistbox.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/ksirc/alistbox.cpp b/ksirc/alistbox.cpp index 7557e2b6..592e4dda 100644 --- a/ksirc/alistbox.cpp +++ b/ksirc/alistbox.cpp @@ -60,7 +60,7 @@ void aListBox::inSort ( nickListItem *lbi) int insert; bool found; insert = searchFor(lbi->text(), found, lbi->op()); - if(found == TRUE){ + if(found){ //kdDebug(5008) << lbi->text() << " is already in nick list!" << endl; return; } @@ -76,8 +76,8 @@ void aListBox::inSort ( TQString text, bool top) { nickListItem *nli = new nickListItem(); nli->setText(text); - if(top == TRUE) - nli->setOp(TRUE); + if(top) + nli->setOp(true); inSort(nli); } @@ -85,7 +85,7 @@ int aListBox::findSep() { uint i = 0; for(; i < count(); i++) - if(item(i)->op() == FALSE) + if(!item(i)->op()) break; // stop now return i; @@ -98,7 +98,7 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) int real_max = 0; int insert; - found = FALSE; + found = false; // If there's nothing in the list, don't try and search it, etc @@ -108,7 +108,7 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) else{ int sep = findSep(); if(sep >= 0){ - if(top == TRUE){ + if(top){ min = 0; max = (sep >= 1) ? sep - 1 : 0; } @@ -149,7 +149,7 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) else {// We got a match? insert = current; min = current; - found = TRUE; + found = true; break; } current = (min + max)/2; @@ -166,13 +166,13 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) else if (compare == 0){// We got a match insert = real_max + 1; min = real_max; - found = TRUE; + found = true; } } // Sanity check - if((top == TRUE && insert > sep) || - (top == FALSE && insert < sep)){ + if((top && insert > sep) || + (!top && insert < sep)){ insert = sep; } @@ -181,7 +181,7 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) // debug("Loop inifitly on: %s", nick.data()); } - if(found == TRUE){ + if(found){ // debug("Found %s", nick.data()); return min; // We found one, so return the number found } @@ -193,20 +193,20 @@ int aListBox::searchFor(const TQString &nick, bool &found, bool top) bool aListBox::isTop(int index) { if(index >= findSep()) - return FALSE; + return false; else - return TRUE; + return true; } int aListBox::findNick(const TQString &str) { bool found; int index; - index = searchFor(str, found, TRUE); - if(found == TRUE) + index = searchFor(str, found, true); + if(found) return index; - index = searchFor(str, found, FALSE); - if(found == TRUE) + index = searchFor(str, found, false); + if(found) return index; // debug("Did not find: %s", str.data()); return -1; @@ -263,7 +263,7 @@ void aListBox::updateNeedNickPrefixFlag() const { m_needNickPrefix = false; - if(ksopts->useColourNickList == false){ + if(!ksopts->useColourNickList){ TQListBoxItem *item = firstItem(); for (; item; item = item->next() ) { @@ -294,7 +294,7 @@ void aListBox::updateNickPrefixWidth() m_nickPrefixWidth = 0; - if(ksopts->useColourNickList == false){ + if(!ksopts->useColourNickList){ nickListItem *item = static_cast<nickListItem *>( firstItem() ); for ( ; item; item = static_cast<nickListItem *>( item->next() ) ) m_nickPrefixWidth = kMax( m_nickPrefixWidth, metrics.width( item->nickPrefix() ) ); @@ -322,10 +322,10 @@ void aListBox::clearAdvOps() nickListItem::nickListItem() : TQListBoxItem() { - is_op = FALSE; - is_voice = FALSE; - is_away = FALSE; - is_ircop = FALSE; + is_op = false; + is_voice = false; + is_away = false; + is_ircop = false; forcedCol = 0x0; } @@ -386,7 +386,7 @@ void nickListItem::paint(TQPainter *p) yPos = fm.ascent() + fm.leading()/2; TQPen pen = p->pen(); TQFont font = p->font(); - if(ksopts->useColourNickList == true) { + if(ksopts->useColourNickList) { if(ksopts->nickColourization){ if(!isSelected()) { @@ -399,7 +399,7 @@ void nickListItem::paint(TQPainter *p) p->setPen(ksopts->selForegroundColor); } - if(is_voice == TRUE){ + if(is_voice){ TQPen open = p->pen(); p->setPen(ksopts->channelColor); p->drawText( nickPosX, yPos, TQString("+") ); @@ -407,7 +407,7 @@ void nickListItem::paint(TQPainter *p) p->setPen(open); // p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), TQBrush(ksopts->channelColor, TQt::Dense7Pattern)); } - if(is_op == TRUE) { + if(is_op) { TQPen open = p->pen(); p->setPen(ksopts->errorColor); p->drawText( nickPosX, yPos, TQString("@") ); @@ -415,9 +415,9 @@ void nickListItem::paint(TQPainter *p) p->setPen(open); // p->fillRect(0,0, listBox()->maxItemWidth(), height(listBox()), TQBrush(ksopts->errorColor, TQt::Dense7Pattern)); } - if(is_away == TRUE) + if(is_away) p->setPen(p->pen().color().dark(150)); - if(is_ircop == TRUE){ + if(is_ircop){ TQPen open = p->pen(); p->setPen(ksopts->errorColor); p->drawText( nickPosX, yPos, TQString("*") ); @@ -428,15 +428,15 @@ void nickListItem::paint(TQPainter *p) } else { - if(is_voice == TRUE) + if(is_voice) p->setPen(ksopts->channelColor); - if(is_op == TRUE) + if(is_op) p->setPen(ksopts->errorColor); - if(is_away == TRUE) + if(is_away) p->setPen(p->pen().color().dark(150)); - if(is_ircop == TRUE){ + if(is_ircop){ TQFont bfont = font; - bfont.setBold(TRUE); + bfont.setBold(true); p->setFont(bfont); } } @@ -444,7 +444,7 @@ void nickListItem::paint(TQPainter *p) else { } - if(ksopts->useColourNickList == false) { + if(!ksopts->useColourNickList) { aListBox *lb = static_cast<aListBox *>( listBox() ); if ( lb->needNickPrefix() ) |