[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.1/kdelibs/solid/solid/backends/hal
From:       Matthias Kretz <kretz () kde ! org>
Date:       2008-08-20 21:05:30
Message-ID: 1219266330.364182.17757.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 850151 by mkretz:

backport: I didn't realize HalAudioInterface needed the fix for handling \
the incompatibility in HAL, too. Now, in order to find out what type of \
soundcard it is, don't look at the direct parent device object but the \
parent of the parent instead (for newer HAL only). Finally my USB device is \
detected as such again.


 M  +13 -3     halaudiointerface.cpp  


--- branches/KDE/4.1/kdelibs/solid/solid/backends/hal/halaudiointerface.cpp \
#850150:850151 @@ -20,6 +20,7 @@
 #include "halaudiointerface.h"
 
 #include "haldevice.h"
+#include <QtDBus/QDBusInterface>
 
 using namespace Solid::Backends::Hal;
 
@@ -161,9 +162,18 @@
         return m_soundcardType;
     }
 
-    if (! m_device->parentUdi().isEmpty())
-    {
-        HalDevice parentDevice(m_device->parentUdi());
+    QString parentUdi = m_device->parentUdi();
+    if (!parentUdi.isEmpty()) {
+        QDBusInterface parentIface(QLatin1String("org.freedesktop.Hal"), \
m_device->parentUdi(), "org.freedesktop.Hal.Device", \
QDBusConnection::systemBus()); +        const QDBusMessage &reply = \
parentIface.call("GetProperty", QLatin1String("info.subsystem")); +        \
if (reply.type() != QDBusMessage::ReplyMessage && reply.errorName() == \
"org.freedesktop.Hal.NoSuchProperty") { +            const QDBusMessage \
&reply2 = parentIface.call("GetProperty", QLatin1String("info.parent")); +  \
if (reply2.type() == QDBusMessage::ReplyMessage) { +                \
parentUdi = reply2.arguments().at(0).toString(); +            }
+        }
+
+        HalDevice parentDevice(parentUdi);
         QString productName = parentDevice.product();
         QString deviceName = name();
         if (productName.contains("headset", Qt::CaseInsensitive) ||


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic