Use initializer for QJsonObject
This avoid detaching the QJsonObject
This commit is contained in:
parent
2c49558f32
commit
8fd954b6d8
1 changed files with 7 additions and 6 deletions
|
@ -92,12 +92,13 @@ void SystemvolumePlugin::sendSinkList() {
|
|||
sendPacket(np);
|
||||
});
|
||||
|
||||
QJsonObject sinkObject;
|
||||
sinkObject.insert("name", sink->name());
|
||||
sinkObject.insert("description", sink->description());
|
||||
sinkObject.insert("muted", sink->isMuted());
|
||||
sinkObject.insert("volume", sink->volume());
|
||||
sinkObject.insert("maxVolume", PulseAudioQt::normalVolume());
|
||||
QJsonObject sinkObject {
|
||||
{"name", sink->name()},
|
||||
{"muted", sink->isMuted()},
|
||||
{"description", sink->description()},
|
||||
{"volume", sink->volume()},
|
||||
{"maxVolume", PulseAudioQt::normalVolume()}
|
||||
};
|
||||
|
||||
array.append(sinkObject);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue