equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the Qt Mobility Components. |
7 ** This file is part of the Qt Mobility Components. |
8 ** |
8 ** |
42 #include <QTimer> |
42 #include <QTimer> |
43 #include <QFile> |
43 #include <QFile> |
44 #include <QDir> |
44 #include <QDir> |
45 |
45 |
46 #if !defined(QT_NO_DBUS) |
46 #if !defined(QT_NO_DBUS) |
47 #include <qhalservice_linux_p.h> |
47 #include "qhalservice_linux_p.h" |
48 #include <QtDBus/QtDBus> |
48 #include <QtDBus/QtDBus> |
49 #include <QtDBus/QDBusConnection> |
49 #include <QtDBus/QDBusConnection> |
50 #include <QtDBus/QDBusError> |
50 #include <QtDBus/QDBusError> |
51 #include <QtDBus/QDBusInterface> |
51 #include <QtDBus/QDBusInterface> |
52 #include <QtDBus/QDBusMessage> |
52 #include <QtDBus/QDBusMessage> |
189 featureSupported = hasSysFeature("video"); |
189 featureSupported = hasSysFeature("video"); |
190 } |
190 } |
191 break; |
191 break; |
192 case QSystemInfo::FmradioFeature : |
192 case QSystemInfo::FmradioFeature : |
193 { |
193 { |
194 const QString sysPath = "/sys/class/video4linux/"; |
194 featureSupported = !(QDir("/sys/class/video4linux/").entryList(QStringList("radio*")).empty()); |
195 const QDir sysDir(sysPath); |
|
196 QStringList filters; |
|
197 filters << "*"; |
|
198 QStringList sysList = sysDir.entryList( filters ,QDir::Dirs, QDir::Name); |
|
199 foreach(const QString dir, sysList) { |
|
200 if (dir.contains("radio")) { |
|
201 featureSupported = true; |
|
202 } |
|
203 } |
|
204 } |
195 } |
205 break; |
196 break; |
206 case QSystemInfo::IrFeature : |
197 case QSystemInfo::IrFeature : |
207 { |
198 { |
208 #if !defined(QT_NO_DBUS) |
199 #if !defined(QT_NO_DBUS) |
282 |
273 |
283 #endif |
274 #endif |
284 break; |
275 break; |
285 case QSystemInfo::VideoOutFeature : |
276 case QSystemInfo::VideoOutFeature : |
286 { |
277 { |
287 const QString sysPath = "/sys/class/video4linux/"; |
278 featureSupported = !(QDir("/sys/class/video4linux/").entryList(QStringList("video*")).empty()); |
288 const QDir sysDir(sysPath); |
|
289 QStringList filters; |
|
290 filters << "*"; |
|
291 const QStringList sysList = sysDir.entryList( filters ,QDir::Dirs, QDir::Name); |
|
292 if(sysList.contains("video")) { |
|
293 featureSupported = true; |
|
294 } |
|
295 } |
279 } |
296 break; |
280 break; |
297 case QSystemInfo::HapticsFeature: |
281 case QSystemInfo::HapticsFeature: |
298 break; |
282 break; |
299 default: |
283 default: |