KDSingleApplicationLocalSocket: Add static_cast to silence narrowing conversion warnings

This commit is contained in:
Jonas Kvinge 2023-06-06 22:25:19 +02:00
parent f03505ab67
commit 0bd68c3817
1 changed files with 3 additions and 3 deletions

View File

@ -125,7 +125,7 @@ bool KDSingleApplicationLocalSocket::sendMessage(const QByteArray &message, int
// until we hit the timeout. // until we hit the timeout.
do { do {
socket.connectToServer(m_socketName); socket.connectToServer(m_socketName);
if (socket.waitForConnected(deadline.remainingTime())) if (socket.waitForConnected(static_cast<int>(deadline.remainingTime())))
break; break;
} while (!deadline.hasExpired()); } while (!deadline.hasExpired());
@ -152,7 +152,7 @@ bool KDSingleApplicationLocalSocket::sendMessage(const QByteArray &message, int
// Should there be one? // Should there be one?
while (socket.bytesToWrite() > 0) { while (socket.bytesToWrite() > 0) {
if (!socket.waitForBytesWritten(deadline.remainingTime())) { if (!socket.waitForBytesWritten(static_cast<int>(deadline.remainingTime()))) {
qCWarning(kdsaLocalSocket) << "Message to primary timed out"; qCWarning(kdsaLocalSocket) << "Message to primary timed out";
return false; return false;
} }
@ -168,7 +168,7 @@ bool KDSingleApplicationLocalSocket::sendMessage(const QByteArray &message, int
return true; return true;
} }
if (!socket.waitForDisconnected(deadline.remainingTime())) { if (!socket.waitForDisconnected(static_cast<int>(deadline.remainingTime()))) {
qCWarning(kdsaLocalSocket) << "Disconnection from primary timed out"; qCWarning(kdsaLocalSocket) << "Disconnection from primary timed out";
return false; return false;
} }