All pastes #783793 Raw Edit

Someone

public text v1 · immutable
·published 2007-11-19 11:17 UTC
rendered paste body
Index: phonon/libkaudiodevicelist/audiodevice.cpp
===================================================================
--- phonon/libkaudiodevicelist/audiodevice.cpp  (revision 738537)
+++ phonon/libkaudiodevicelist/audiodevice.cpp  (working copy)
@@ -129,6 +129,7 @@
     //kDebug(603) << audioHw->driverHandle();
     d->udi = d->uniqueIdentifierFromDevice(audioDevice);
     d->driver = audioHw->driver();
+    d->cardName = audioHw->name();
     const QVariant handle = audioHw->driverHandle();
     if (d->udi.isEmpty()) {
         Solid::Device parent = audioDevice.parent();
@@ -154,7 +155,13 @@
                     if (handle.type() == QVariant::List) {
                         const QList<QVariant> handles = handle.toList();
                         if (handles.size() > 1 && handles.at(1).isValid()) {
-                            d->udi += QLatin1Char(':') + handles.at(1).toString();
+                            int card = handles.at(0).toString();
+                            int dev = handles.at(1).toString();
+                            d->udi += QLatin1Char(':') + QString::number(dev);
+                            // Change the name of secondary devices on a card
+                            if (dev) {
+                               d->carName += " #" + QString::number(dev + 1);
+                            }
                         }
                     }
                     break;
@@ -179,7 +186,6 @@
             d->udi += QString::number(audioHw->deviceType());
         }
     }
-    d->cardName = audioHw->name();

     // prefer devices Solid tells us about
     d->initialPreference += 5;