Don't delete profiles and ports on update
ClosedPublic

Authored by nicolasfella on Apr 27 2019, 4:20 PM.

Details

Summary

When a profile/port is updated the old code deletes all objects and creates new ones. This breaks connections set on the objects.

In Card the return type of ports() is changed from QVector<Port*> to QVector<CardPort*>. This probably breaks API/ABI, but the only current user (KDE Connect) is not affected and we don't give ABI guarantees.

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.
nicolasfella created this revision.Apr 27 2019, 4:20 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 27 2019, 4:20 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nicolasfella requested review of this revision.Apr 27 2019, 4:20 PM
apol added a subscriber: apol.Apr 29 2019, 12:10 AM

the patch looks good. +1

@drosca Does this look good to you?

drosca accepted this revision.May 6 2019, 3:34 PM
drosca added inline comments.
src/card.cpp
78

const QString &profileKey

99

coding style

src/device.cpp
53

This is not ideal, but other than keeping and updating the vector with the hash there is no other way.

src/device_p.h
94

coding style

This revision is now accepted and ready to land.May 6 2019, 3:34 PM
nicolasfella marked an inline comment as done.May 6 2019, 5:09 PM
This revision was automatically updated to reflect the committed changes.
nicolasfella marked 2 inline comments as done.May 6 2019, 5:10 PM