[Context] Update StreamRestore before inserting it
ClosedPublic

Authored by broulik on Apr 4 2019, 4:42 PM.

Details

Summary

Otherwise we would signal an empty StreamRestore only to then signal it has changed

Test Plan
connect(PulseAudioQt::Context::instance(), &PulseAudioQt::Context::streamRestoreAdded, this, [this](PulseAudioQt::StreamRestore *resto) {
    qDebug() << "Restored" << resto->name();
});

prints Restored "sink-input-by-media-role:event" now instead of Restored ""

Diff Detail

Repository
R994 Pulseaudio Qt Bindings
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Apr 4 2019, 4:42 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 4 2019, 4:42 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Apr 4 2019, 4:42 PM

If obj already exists this would result in having it in m_streamRestores twice, wouldn't it?

broulik planned changes to this revision.Apr 4 2019, 5:28 PM
broulik updated this revision to Diff 55462.Apr 5 2019, 10:07 AM
  • Insert only if not already
drosca accepted this revision.Apr 5 2019, 10:17 AM
This revision is now accepted and ready to land.Apr 5 2019, 10:17 AM
This revision was automatically updated to reflect the committed changes.