summaryrefslogtreecommitdiff
path: root/libmatemixer/matemixer-switch.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-09-06 19:09:41 +0200
committerMichal Ratajsky <[email protected]>2014-09-06 19:09:41 +0200
commit5997585cc046956479feffea7c414bea2814d403 (patch)
tree9f911fca5423a93c837a91bedaf8257d1e47f015 /libmatemixer/matemixer-switch.c
parent1a9410a38aebb6ce05d43433c020e198416761df (diff)
downloadlibmatemixer-5997585cc046956479feffea7c414bea2814d403.tar.bz2
libmatemixer-5997585cc046956479feffea7c414bea2814d403.tar.xz
Minor code and styling improvements
Diffstat (limited to 'libmatemixer/matemixer-switch.c')
-rw-r--r--libmatemixer/matemixer-switch.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libmatemixer/matemixer-switch.c b/libmatemixer/matemixer-switch.c
index 926c9a6..87580dd 100644
--- a/libmatemixer/matemixer-switch.c
+++ b/libmatemixer/matemixer-switch.c
@@ -356,14 +356,16 @@ gboolean
mate_mixer_switch_set_active_option (MateMixerSwitch *swtch,
MateMixerSwitchOption *option)
{
+ MateMixerSwitchClass *klass;
+
g_return_val_if_fail (MATE_MIXER_IS_SWITCH (swtch), FALSE);
- if (swtch->priv->active != option) {
- MateMixerSwitchClass *klass;
+ klass = MATE_MIXER_SWITCH_GET_CLASS (swtch);
+ if (klass->set_active_option == NULL)
+ return FALSE;
- klass = MATE_MIXER_SWITCH_GET_CLASS (swtch);
- if (klass->set_active_option == NULL ||
- klass->set_active_option (swtch, option) == FALSE)
+ if (swtch->priv->active != option) {
+ if (klass->set_active_option (swtch, option) == FALSE)
return FALSE;
_mate_mixer_switch_set_active_option (swtch, option);
@@ -409,8 +411,7 @@ _mate_mixer_switch_set_active_option (MateMixerSwitch *swtch,
else
swtch->priv->active = NULL;
- g_object_notify_by_pspec (G_OBJECT (swtch),
- properties[PROP_ACTIVE_OPTION]);
+ g_object_notify_by_pspec (G_OBJECT (swtch), properties[PROP_ACTIVE_OPTION]);
}
static MateMixerSwitchOption *