From 97b89e8056e82af76045443f0967c34d20b12fc0 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 28 Aug 2014 22:39:23 +0200 Subject: Avoid using toggle as a port switch and fix indentation --- mate-volume-control/src/gvc-mixer-dialog.c | 39 ++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'mate-volume-control') diff --git a/mate-volume-control/src/gvc-mixer-dialog.c b/mate-volume-control/src/gvc-mixer-dialog.c index 2ddc5ea..26e0540 100644 --- a/mate-volume-control/src/gvc-mixer-dialog.c +++ b/mate-volume-control/src/gvc-mixer-dialog.c @@ -139,35 +139,38 @@ G_DEFINE_TYPE (GvcMixerDialog, gvc_mixer_dialog, GTK_TYPE_DIALOG) static MateMixerSwitch * find_stream_port_switch (MateMixerStream *stream) { - const GList *switches; + const GList *switches; - switches = mate_mixer_stream_list_switches (stream); - while (switches != NULL) { - MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data); + switches = mate_mixer_stream_list_switches (stream); + while (switches != NULL) { + MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data); + MateMixerSwitchFlags flags; - if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_PORT) - return swtch; + flags = mate_mixer_switch_get_flags (swtch); + if ((flags & MATE_MIXER_SWITCH_TOGGLE) == 0 && + mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_PORT) + return swtch; - switches = switches->next; - } - return NULL; + switches = switches->next; + } + return NULL; } static MateMixerSwitch * find_device_profile_switch (MateMixerDevice *device) { - const GList *switches; + const GList *switches; - switches = mate_mixer_device_list_switches (device); - while (switches != NULL) { - MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data); + switches = mate_mixer_device_list_switches (device); + while (switches != NULL) { + MateMixerSwitch *swtch = MATE_MIXER_SWITCH (switches->data); - if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_DEVICE_PROFILE) - return swtch; + if (mate_mixer_switch_get_role (swtch) == MATE_MIXER_SWITCH_ROLE_DEVICE_PROFILE) + return swtch; - switches = switches->next; - } - return NULL; + switches = switches->next; + } + return NULL; } static MateMixerStream * -- cgit v1.2.1