summaryrefslogtreecommitdiff
path: root/libmatemixer/matemixer-stream.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-stream.c
parent1a9410a38aebb6ce05d43433c020e198416761df (diff)
downloadlibmatemixer-5997585cc046956479feffea7c414bea2814d403.tar.bz2
libmatemixer-5997585cc046956479feffea7c414bea2814d403.tar.xz
Minor code and styling improvements
Diffstat (limited to 'libmatemixer/matemixer-stream.c')
-rw-r--r--libmatemixer/matemixer-stream.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/libmatemixer/matemixer-stream.c b/libmatemixer/matemixer-stream.c
index a4e2de4..3d8b96e 100644
--- a/libmatemixer/matemixer-stream.c
+++ b/libmatemixer/matemixer-stream.c
@@ -300,6 +300,7 @@ mate_mixer_stream_finalize (GObject *object)
stream = MATE_MIXER_STREAM (object);
g_free (stream->priv->name);
+ g_free (stream->priv->label);
G_OBJECT_CLASS (mate_mixer_stream_parent_class)->finalize (object);
}
@@ -399,9 +400,16 @@ mate_mixer_stream_get_default_control (MateMixerStream *stream)
const GList *
mate_mixer_stream_list_controls (MateMixerStream *stream)
{
+ MateMixerStreamClass *klass;
+
g_return_val_if_fail (MATE_MIXER_IS_STREAM (stream), NULL);
- return MATE_MIXER_STREAM_GET_CLASS (stream)->list_controls (stream);
+ klass = MATE_MIXER_STREAM_GET_CLASS (stream);
+
+ if G_LIKELY (klass->list_controls != NULL)
+ return klass->list_controls (stream);
+
+ return NULL;
}
/**
@@ -411,9 +419,16 @@ mate_mixer_stream_list_controls (MateMixerStream *stream)
const GList *
mate_mixer_stream_list_switches (MateMixerStream *stream)
{
+ MateMixerStreamClass *klass;
+
g_return_val_if_fail (MATE_MIXER_IS_STREAM (stream), NULL);
- return MATE_MIXER_STREAM_GET_CLASS (stream)->list_switches (stream);
+ klass = MATE_MIXER_STREAM_GET_CLASS (stream);
+
+ if G_LIKELY (klass->list_switches != NULL)
+ return klass->list_switches (stream);
+
+ return NULL;
}
static MateMixerStreamControl *
@@ -483,6 +498,5 @@ _mate_mixer_stream_set_default_control (MateMixerStream *stream,
mate_mixer_stream_get_name (stream));
}
- g_object_notify_by_pspec (G_OBJECT (stream),
- properties[PROP_DEFAULT_CONTROL]);
+ g_object_notify_by_pspec (G_OBJECT (stream), properties[PROP_DEFAULT_CONTROL]);
}