9 |
9 |
10 |
10 |
11 import collections |
11 import collections |
12 |
12 |
13 from PyQt5.QtCore import QObject, pyqtSignal, QProcess, QRegExp |
13 from PyQt5.QtCore import QObject, pyqtSignal, QProcess, QRegExp |
14 from PyQt5.QtNetwork import QHostInfo, QHostAddress, QAbstractSocket, \ |
14 from PyQt5.QtNetwork import ( |
15 QNetworkInterface |
15 QHostInfo, QHostAddress, QAbstractSocket, QNetworkInterface |
|
16 ) |
16 |
17 |
17 from .CooperationServer import CooperationServer |
18 from .CooperationServer import CooperationServer |
18 from .Connection import Connection |
19 from .Connection import Connection |
19 |
20 |
20 import Preferences |
21 import Preferences |
159 Public method to remove a connection. |
160 Public method to remove a connection. |
160 |
161 |
161 @param connection reference to the connection to be removed |
162 @param connection reference to the connection to be removed |
162 (Connection) |
163 (Connection) |
163 """ |
164 """ |
164 if connection.peerAddress() in self.__peers and \ |
165 if (connection.peerAddress() in self.__peers and |
165 connection in self.__peers[connection.peerAddress()]: |
166 connection in self.__peers[connection.peerAddress()]): |
166 self.__peers[connection.peerAddress()].remove(connection) |
167 self.__peers[connection.peerAddress()].remove(connection) |
167 nick = connection.name() |
168 nick = connection.name() |
168 if nick != "": |
169 if nick != "": |
169 self.participantLeft.emit(nick) |
170 self.participantLeft.emit(nick) |
170 |
171 |