diff options
-rw-r--r-- | resource/listener.cpp | 6 | ||||
-rw-r--r-- | resource/listener.h | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/resource/listener.cpp b/resource/listener.cpp index e68b3d4..ae16da7 100644 --- a/resource/listener.cpp +++ b/resource/listener.cpp | |||
@@ -47,7 +47,7 @@ void Listener::acceptConnection() | |||
47 | } | 47 | } |
48 | 48 | ||
49 | Console::main()->log("Got a connection"); | 49 | Console::main()->log("Got a connection"); |
50 | Client client(connection); | 50 | Client client("Unknown Client" /*fixme: actual names!*/, connection); |
51 | m_connections << client; | 51 | m_connections << client; |
52 | connect(connection, &QLocalSocket::disconnected, | 52 | connect(connection, &QLocalSocket::disconnected, |
53 | this, &Listener::clientDropped); | 53 | this, &Listener::clientDropped); |
@@ -65,8 +65,8 @@ void Listener::clientDropped() | |||
65 | QMutableListIterator<Client> it(m_connections); | 65 | QMutableListIterator<Client> it(m_connections); |
66 | while (it.hasNext()) { | 66 | while (it.hasNext()) { |
67 | const Client &client = it.next(); | 67 | const Client &client = it.next(); |
68 | if (client.m_socket == connection) { | 68 | if (client.socket == connection) { |
69 | Console::main()->log(" dropped..."); | 69 | Console::main()->log(QString(" dropped... %1").arg(client.name)); |
70 | it.remove(); | 70 | it.remove(); |
71 | break; | 71 | break; |
72 | } | 72 | } |
diff --git a/resource/listener.h b/resource/listener.h index 2fbd75c..1d41467 100644 --- a/resource/listener.h +++ b/resource/listener.h | |||
@@ -8,14 +8,16 @@ | |||
8 | class Client | 8 | class Client |
9 | { | 9 | { |
10 | public: | 10 | public: |
11 | Client(QLocalSocket *s) | 11 | Client(const QString &n, QLocalSocket *s) |
12 | : m_socket(s), | 12 | : name(n), |
13 | m_commanded(false) | 13 | socket(s), |
14 | hasSentCommand(false) | ||
14 | { | 15 | { |
15 | } | 16 | } |
16 | 17 | ||
17 | QLocalSocket *m_socket; | 18 | QString name; |
18 | bool m_commanded; | 19 | QLocalSocket *socket; |
20 | bool hasSentCommand; | ||
19 | }; | 21 | }; |
20 | 22 | ||
21 | class Listener : public QObject | 23 | class Listener : public QObject |