mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Fix issue #123
This commit is contained in:
parent
f8e6cb2cad
commit
80ac10bbf1
@ -402,6 +402,7 @@ void ScreenPlayManager::newConnection()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
qWarning() << "No matching connection found!";
|
||||||
});
|
});
|
||||||
m_clients.append(connection);
|
m_clients.append(connection);
|
||||||
}
|
}
|
||||||
@ -452,11 +453,13 @@ bool ScreenPlayManager::closeConntectionByType(const QStringList& types)
|
|||||||
for (auto& client : m_clients) {
|
for (auto& client : m_clients) {
|
||||||
if (types.contains(client->type(), Qt::CaseInsensitive)) {
|
if (types.contains(client->type(), Qt::CaseInsensitive)) {
|
||||||
client->close();
|
client->close();
|
||||||
return m_clients.removeOne(client);
|
if (!m_clients.removeOne(client)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -60,6 +60,8 @@ void ScreenPlay::SDKConnection::readyRead()
|
|||||||
qCritical() << "Wallpaper type not found. Expected: " << GlobalVariables::getAvailableTypes() << " got: " << msg;
|
qCritical() << "Wallpaper type not found. Expected: " << GlobalVariables::getAvailableTypes() << " got: " << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qInfo() << "New connection" << m_appID << msg;
|
||||||
|
|
||||||
emit appConnected(this);
|
emit appConnected(this);
|
||||||
|
|
||||||
} else if (msg.startsWith("command=")) {
|
} else if (msg.startsWith("command=")) {
|
||||||
@ -99,7 +101,7 @@ void ScreenPlay::SDKConnection::sendMessage(const QByteArray& message)
|
|||||||
void ScreenPlay::SDKConnection::close()
|
void ScreenPlay::SDKConnection::close()
|
||||||
{
|
{
|
||||||
|
|
||||||
qInfo() << "Close " << m_type;
|
qInfo() << "Close " << m_type << m_appID;
|
||||||
|
|
||||||
QJsonObject obj;
|
QJsonObject obj;
|
||||||
obj.insert("command", QJsonValue("quit"));
|
obj.insert("command", QJsonValue("quit"));
|
||||||
|
Loading…
Reference in New Issue
Block a user