mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Add informative messages after Q_ASSERTs for sockets in FileProviderSocketController for release mode
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
3254595fa4
commit
95c6e7a3f4
1 changed files with 15 additions and 0 deletions
|
@ -53,6 +53,11 @@ void FileProviderSocketController::slotSocketDestroyed(const QObject * const obj
|
|||
void FileProviderSocketController::slotReadyRead()
|
||||
{
|
||||
Q_ASSERT(_socket);
|
||||
if (!_socket) {
|
||||
qCWarning(lcFileProviderSocketController) << "Cannot read data on dead socket";
|
||||
return;
|
||||
}
|
||||
|
||||
while(_socket->canReadLine()) {
|
||||
const auto line = QString::fromUtf8(_socket->readLine().trimmed()).normalized(QString::NormalizationForm_C);
|
||||
qCDebug(lcFileProviderSocketController) << "Received message in file provider socket:" << line;
|
||||
|
@ -125,12 +130,22 @@ void FileProviderSocketController::sendMessage(const QString &message) const
|
|||
void FileProviderSocketController::start()
|
||||
{
|
||||
Q_ASSERT(_socket);
|
||||
if (!_socket) {
|
||||
qCWarning(lcFileProviderSocketController) << "Cannot start communication on dead socket";
|
||||
return;
|
||||
}
|
||||
|
||||
requestFileProviderDomainInfo();
|
||||
}
|
||||
|
||||
void FileProviderSocketController::requestFileProviderDomainInfo() const
|
||||
{
|
||||
Q_ASSERT(_socket);
|
||||
if (!_socket) {
|
||||
qCWarning(lcFileProviderSocketController) << "Cannot request file provider domain data on dead socket";
|
||||
return;
|
||||
}
|
||||
|
||||
const auto requestMessage = QStringLiteral("SEND_FILE_PROVIDER_DOMAIN_IDENTIFIER");
|
||||
sendMessage(requestMessage);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue