mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-06 19:12:30 +01:00
Add explicit quit command when removing a wallpaper
This commit is contained in:
parent
d67ccb5e8f
commit
43666b0860
@ -188,6 +188,16 @@ public slots:
|
||||
|
||||
void close()
|
||||
{
|
||||
|
||||
qInfo() << "Close " << m_type;
|
||||
|
||||
QJsonObject obj;
|
||||
obj.insert("command", QJsonValue("quit"));
|
||||
QByteArray command = QJsonDocument(obj).toJson();
|
||||
|
||||
m_socket->write(command);
|
||||
m_socket->waitForBytesWritten();
|
||||
|
||||
if (m_socket->state() == QLocalSocket::ConnectedState) {
|
||||
m_socket->disconnectFromServer();
|
||||
m_socket->close();
|
||||
|
@ -77,6 +77,15 @@ void ScreenPlaySDK::readyRead()
|
||||
return;
|
||||
}
|
||||
QJsonObject ob = doc.object();
|
||||
|
||||
if(ob.size() == 1){
|
||||
if(ob.contains("command")){
|
||||
if(ob.value("command") == "quit"){
|
||||
emit sdkDisconnected();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
QJsonObject::iterator iterator;
|
||||
for (iterator = ob.begin(); iterator != ob.end(); iterator++) {
|
||||
emit incommingMessage(iterator.key(), ob.value(iterator.key()).toString());
|
||||
|
Loading…
Reference in New Issue
Block a user