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

List:       kde-commits
Subject:    KDE/kdelibs/solid/solid/backends/hal
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2007-11-19 16:41:55
Message-ID: 1195490515.079598.20615.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 738775 by wstephens:

Filter out video4linux devices from this call that are not video
sources.  The 2nd call to hal is regrettable but unavoidable, since
FindDeviceStringMatch only matches exact matches, so you can't query it
for device paths containing 'video'.

Patch reviewed by Kévin Ottens.


 M  +25 -2     halmanager.cpp  


--- trunk/KDE/kdelibs/solid/solid/backends/hal/halmanager.cpp #738774:738775
@@ -178,8 +178,31 @@
             qWarning() << Q_FUNC_INFO << " error: " << reply.error().name() << endl;
             return QStringList();
         }
-
-        result << reply;
+        if ( cap == QLatin1String( "video4linux" ) )
+        {
+            QStringList foundDevices ( reply );
+            QStringList filtered;
+            foreach ( QString udi, foundDevices )
+            {
+                QDBusInterface device( "org.freedesktop.Hal", udi, \
"org.freedesktop.Hal.Device", QDBusConnection::systemBus() ); +                \
QDBusReply<QString> reply = device.call( "GetProperty", "video4linux.device" ); +     \
if (!reply.isValid()) +                {
+                    qWarning() << Q_FUNC_INFO << " error getting video4linux.device: \
" << reply.error().name() << endl; +                    continue;
+                }
+                if ( !reply.value().contains( "video" ) )
+                {
+                    continue;
+                }
+                filtered.append( udi );
+            }
+            result += filtered;
+        }
+        else
+        {
+            result << reply;
+        }
     }
 
     return result;


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

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