[gnome-control-center] sound: Make sort_profiles public
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sound: Make sort_profiles public
- Date: Wed, 11 Jul 2012 15:21:32 +0000 (UTC)
commit e32a02e2dda8432572075e9134a9a04abdbecbae
Author: Conor Curran <conor curran canonical com>
Date: Wed Jul 11 12:49:20 2012 +0100
sound: Make sort_profiles public
And rename it to gvc_mixer_card_profile_compare()
https://bugzilla.gnome.org/show_bug.cgi?id=674831
panels/sound/gvc-mixer-card.c | 15 ++++++++++-----
panels/sound/gvc-mixer-card.h | 3 +++
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-card.c b/panels/sound/gvc-mixer-card.c
index 887220c..a9b246f 100644
--- a/panels/sound/gvc-mixer-card.c
+++ b/panels/sound/gvc-mixer-card.c
@@ -290,9 +290,15 @@ gvc_mixer_card_get_ports (GvcMixerCard *card)
return card->priv->ports;
}
-static int
-sort_profiles (GvcMixerCardProfile *a,
- GvcMixerCardProfile *b)
+/**
+ * gvc_mixer_card_profile_compare:
+ *
+ * Return value: 1 if @a has a higher priority, -1 if @b has a higher
+ * priority, 0 if @a and @b have the same priority.
+ */
+int
+gvc_mixer_card_profile_compare (GvcMixerCardProfile *a,
+ GvcMixerCardProfile *b)
{
if (a->priority == b->priority)
return 0;
@@ -301,7 +307,6 @@ sort_profiles (GvcMixerCardProfile *a,
return -1;
}
-
/**
* gvc_mixer_card_set_profiles:
* @profiles: (transfer full) (element-type GvcMixerCardProfile):
@@ -313,7 +318,7 @@ gvc_mixer_card_set_profiles (GvcMixerCard *card,
g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
g_return_val_if_fail (card->priv->profiles == NULL, FALSE);
- card->priv->profiles = g_list_sort (profiles, (GCompareFunc) sort_profiles);
+ card->priv->profiles = g_list_sort (profiles, (GCompareFunc) gvc_mixer_card_profile_compare);
return TRUE;
}
diff --git a/panels/sound/gvc-mixer-card.h b/panels/sound/gvc-mixer-card.h
index f115a5c..7fd6d4c 100644
--- a/panels/sound/gvc-mixer-card.h
+++ b/panels/sound/gvc-mixer-card.h
@@ -81,6 +81,9 @@ gboolean gvc_mixer_card_change_profile (GvcMixerCard *card,
const char *profile);
GIcon * gvc_mixer_card_get_gicon (GvcMixerCard *card);
+int gvc_mixer_card_profile_compare (GvcMixerCardProfile *a,
+ GvcMixerCardProfile *b);
+
/* private */
gboolean gvc_mixer_card_set_name (GvcMixerCard *card,
const char *name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]