Use initializer for QJsonObject

This avoid detaching the QJsonObject
This commit is contained in:
Nicolas Fella 2019-04-22 20:02:59 +02:00
parent 2c49558f32
commit 8fd954b6d8

View file

@ -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);
}