integrating chattools in mainwindow chat

This commit is contained in:
doitux
2007-10-12 18:45:28 +00:00
parent 13e32d0656
commit bb9677835a
6 changed files with 25 additions and 18 deletions
+11 -4
View File
@@ -63,7 +63,7 @@ void ChatTools::nickAutoCompletition() {
if(nickAutoCompletitionCounter == 0) {
if(myNickTreeWidget) {
cout << "use Treewidget niclist" << endl;
// cout << "use Treewidget niclist" << endl;
QTreeWidgetItemIterator it(myNickTreeWidget);
while (*it) {
if ((*it)->text(0).startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
@@ -73,11 +73,14 @@ void ChatTools::nickAutoCompletition() {
}
if(!myNickStringList.isEmpty()) {
cout << "use static nickList" << endl;
// cout << "use static nickList" << endl;
QStringListIterator it(myNickStringList);
while (it.hasNext())
cout << it.next().toLocal8Bit().constData() << endl;
while (it.hasNext()) {
QString next = it.next();
if (next.startsWith(myChatStringList.last(), Qt::CaseInsensitive) && myChatStringList.last() != "")
matchStringList << next;
}
//TODO code for static nickList
}
}
@@ -91,6 +94,8 @@ void ChatTools::nickAutoCompletition() {
myChatStringList.removeLast();
// cout << nickAutoCompletitionCounter << endl;
if(nickAutoCompletitionCounter == 0) {
//first one
lastChatString = myChatStringList.join(" ");
@@ -99,6 +104,8 @@ void ChatTools::nickAutoCompletition() {
if(nickAutoCompletitionCounter == lastMatchStringList.size()) nickAutoCompletitionCounter = 0;
cout << nickAutoCompletitionCounter << endl;
// cout << nickAutoCompletitionCounter << "\n";
if(lastChatString == "")