nick highlighting also works now for nicks with whitespace
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -53,8 +53,11 @@ public slots:
|
||||
void setChatTextEdited();
|
||||
|
||||
void setPlayerNicksList(QStringList value) { myNickStringList = value; }
|
||||
void setMyNick ( const QString& theValue ) { myNick = theValue; }
|
||||
|
||||
|
||||
private:
|
||||
|
||||
QStringList chatLinesHistory;
|
||||
QString lastChatString;
|
||||
QStringList lastMatchStringList;
|
||||
@@ -68,6 +71,7 @@ private:
|
||||
int myNotifyMode; // 0 == no notification, 1 == bold notification, 2 == yellow notification
|
||||
ConfigFile *myConfig;
|
||||
|
||||
QString myNick;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user