examples/network/network-chat/client.cpp
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 30 5dc02b23752f
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the examples of the Qt Toolkit.
     7 ** This file is part of the examples of the Qt Toolkit.
     8 **
     8 **
    67         connection->sendMessage(message);
    67         connection->sendMessage(message);
    68 }
    68 }
    69 
    69 
    70 QString Client::nickName() const
    70 QString Client::nickName() const
    71 {
    71 {
    72     return QString(peerManager->userName()) + "@" + QHostInfo::localHostName()
    72     return QString(peerManager->userName()) + '@' + QHostInfo::localHostName()
    73            + ":" + QString::number(server.serverPort());
    73            + ':' + QString::number(server.serverPort());
    74 }
    74 }
    75 
    75 
    76 bool Client::hasConnection(const QHostAddress &senderIp, int senderPort) const
    76 bool Client::hasConnection(const QHostAddress &senderIp, int senderPort) const
    77 {
    77 {
    78     if (senderPort == -1)
    78     if (senderPort == -1)