Pass the profile object instead of the profile name to pa_card_set_profile()
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Wed, 20 Nov 2013 13:42:26 +0000 (15:42 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 29 Nov 2013 05:25:13 +0000 (07:25 +0200)
commitce304d62087b51ce592e9489381ba49750392f60
treed063463f7c111dfc285ed3235810b2c81bd100c1
parentbee86af3ccc247834bf38a57296958f9cd35ffc4
Pass the profile object instead of the profile name to pa_card_set_profile()

When setting attribute foo, or in this case the card profile, in my
opinion the thing passed to the set_foo() function should be of the
type of foo, not a string identifier that can be used to search for
the actual foo in set_foo().

This is mostly a question of taste, but there's at least some small
benefit from passing the actual object: often the profile object is
already available when calling pa_card_set_profile(), so passing the
card name would cause unnecessary searching when pa_card_set_profile()
needs to look up the profile from the hashmap.
12 files changed:
src/modules/bluetooth/module-bluetooth-policy.c
src/modules/bluetooth/module-bluez4-device.c
src/modules/bluetooth/module-bluez5-device.c
src/modules/dbus/iface-card-profile.c
src/modules/dbus/iface-card-profile.h
src/modules/dbus/iface-card.c
src/modules/module-card-restore.c
src/modules/module-switch-on-port-available.c
src/pulsecore/card.c
src/pulsecore/card.h
src/pulsecore/cli-command.c
src/pulsecore/protocol-native.c