Hello,
I'm trying to find a string inside a QStringList which is in a loop, but it doesn't seem to be working. I'm not sure whether I'm doing it right or not.
I tried debugging it for hours with no luck. It might be the way I'm parsing the data coming from the QTcpSocket ?
Am i doing it wrong?

The code is below:

Qt Code:
  1. void Core::connected()
  2. QTextStream in(tcpSocket);
  3. QString data;
  4. do
  5. {
  6. data = in.readLine();
  7. QStringList words = data.split(" ");
  8.  
  9. if ( words.count() > 2 )
  10. {
  11. // at this point, words should be something like = ("nmuntz@localhost", "MSG", ":VERSION");
  12. if ( words.contains(":VERSION", Qt::CaseInsensitive) )
  13. qDebug() << "words contains the word version!!!";
  14. }
  15.  
  16. while ( !in.atEnd() ) ;
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

Thanks a lot in advance!
Greetings.