refactor: Connect socket events in ctor for daemon IPC client
This commit is contained in:
parent
dc6383d593
commit
389028ccf9
1 changed files with 2 additions and 3 deletions
|
|
@ -21,6 +21,8 @@ DaemonIpcClient::DaemonIpcClient(QObject *parent)
|
|||
: QObject(parent),
|
||||
m_socket{new QLocalSocket(this)} // NOSONAR - Qt memory
|
||||
{
|
||||
connect(m_socket, &QLocalSocket::disconnected, this, &DaemonIpcClient::handleDisconnected);
|
||||
connect(m_socket, &QLocalSocket::errorOccurred, this, &DaemonIpcClient::handleErrorOccurred);
|
||||
}
|
||||
|
||||
bool DaemonIpcClient::connectToServer()
|
||||
|
|
@ -38,9 +40,6 @@ bool DaemonIpcClient::connectToServer()
|
|||
return false;
|
||||
}
|
||||
|
||||
connect(m_socket, &QLocalSocket::disconnected, this, &DaemonIpcClient::handleDisconnected);
|
||||
connect(m_socket, &QLocalSocket::errorOccurred, this, &DaemonIpcClient::handleErrorOccurred);
|
||||
|
||||
m_connected = true;
|
||||
qInfo() << "ipc client connected to server:" << kDaemonIpcName;
|
||||
Q_EMIT connected();
|
||||
|
|
|
|||
Loading…
Reference in a new issue