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); sendPacket(np);
}); });
QJsonObject sinkObject; QJsonObject sinkObject {
sinkObject.insert("name", sink->name()); {"name", sink->name()},
sinkObject.insert("description", sink->description()); {"muted", sink->isMuted()},
sinkObject.insert("muted", sink->isMuted()); {"description", sink->description()},
sinkObject.insert("volume", sink->volume()); {"volume", sink->volume()},
sinkObject.insert("maxVolume", PulseAudioQt::normalVolume()); {"maxVolume", PulseAudioQt::normalVolume()}
};
array.append(sinkObject); array.append(sinkObject);
} }