]> code.delx.au - pulseaudio/commitdiff
try more things to get a proper icon for sinks/sources
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Mar 2009 17:37:14 +0000 (18:37 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Mar 2009 17:37:14 +0000 (18:37 +0100)
src/pulsecore/sink.c

index 667ae761c941e46c281dcb7765eca70ad0e37083..ff8700c71edc8aeabea771bc23d7c9c453a0a018 100644 (file)
@@ -1902,7 +1902,7 @@ size_t pa_sink_get_max_request(pa_sink *s) {
 
 /* Called from main context */
 pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
-    const char *ff, *t = NULL, *s = "", *profile, *bus;
+    const char *ff, *c, *t = NULL, *s = "", *profile, *bus;
 
     pa_assert(p);
 
@@ -1919,8 +1919,15 @@ pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
             t = "computer";
         else if (pa_streq(ff, "handset"))
             t = "phone";
+        else if (pa_streq(ff, "portable"))
+            t = "multimedia-player";
     }
 
+    if (!t)
+        if ((c = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
+            if (pa_streq(c, "modem"))
+                t = "modem";
+
     if (!t) {
         if (is_sink)
             t = "audio-card";
@@ -1957,6 +1964,12 @@ pa_bool_t pa_device_init_description(pa_proplist *p) {
             return TRUE;
         }
 
+    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
+        if (pa_streq(s, "modem")) {
+            pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Modem"));
+            return TRUE;
+        }
+
     if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME))) {
         pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
         return TRUE;