nick highlighting also works now for nicks with whitespace

This commit is contained in:
doitux
2007-12-12 22:01:40 +00:00
parent 1a99169556
commit d61027b265
3 changed files with 16 additions and 4 deletions
+7 -2
View File
@@ -25,7 +25,7 @@
using namespace std;
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c)
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, int notifyMode, QTextBrowser *b, QTreeWidget *t) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickTreeWidget(t), myNickStringList(NULL), myTextBrowser(b), myNotifyMode(notifyMode), myConfig(c), myNick("")
{
}
@@ -53,7 +53,12 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
message = message.replace(">",">");
QString tempMsg;
if(message.contains(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()), Qt::CaseInsensitive)) {
QString nickString;
if(myNick == "") { nickString = QString::fromUtf8(myConfig->readConfigString("MyName").c_str()); }
else { nickString = myNick; }
if(message.contains(nickString, Qt::CaseInsensitive)) {
switch (myNotifyMode) {
case 0: tempMsg = message;