OSDN Git Service

Fixed memberlist format.
[greensite/jasmine.git] / ui / jasmine_mainwindow.cxx
index 89ba54d..a4e9eb1 100644 (file)
@@ -66,14 +66,6 @@ void mainWindow::showEvent(QShowEvent *event){
                this->status->showMessage("<font color=\"#ff0000\">Don't forget almost all features are not implemented!</font>",default_status_interval);
        event->accept();
 }
-bool mainWindow::isInMember(const AddressAndPort &peer,bool matchIPOnly){
-       QList<AddressAndPort> iplist=this->memberList->addressPortList();
-       foreach(AddressAndPort addressPort,iplist){
-               if(matchIPOnly&&peer.first==addressPort.first) return true;
-               else if(peer==addressPort) return true;
-       }
-       return false;
-}
 
 //Client behavior
 void mainWindow::on_sendButton_clicked(){
@@ -299,7 +291,7 @@ bool mainWindow::tcpserver_pending(const tcpSocket &socket){
 #ifdef DEBUG
        qDebug()<<"Pending:"<<socket.peerAddress().toString()<<" Port:"<<socket.peerPort();
 #endif
-       if(!this->isInMember(AddressAndPort(socket.peerAddress(),0),true)) return false;
+       if(this->memberList->isInMember(AddressAndPort(socket.peerAddress(),0),true)<0) return false;
        connect(&socket,
                        SIGNAL(msg_received(const QString &)),
                        SLOT(tcpserver_msg_received(const QString &)));