tslib: Derive default device value from TSLIB_TSDEVICE environment variable

Most devices that use tslib have the device path defined by
the TSLIB_TSDEVICE env. variable.

Change-Id: I89fc17cb2c7fba7741de2fd348aacd608cb21a2a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Daniel Giurcanu 2013-12-17 14:48:05 +01:00 committed by The Qt Project
parent 1e44ff671e
commit dbf3c559da

View File

@ -64,7 +64,10 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
qDebug() << "QTsLibMouseHandler" << key << specification;
setObjectName(QLatin1String("TSLib Mouse Handler"));
QByteArray device = "/dev/input/event1";
QByteArray device = qgetenv("TSLIB_TSDEVICE");
if (device.isEmpty())
device = QByteArrayLiteral("/dev/input/event1");
if (specification.startsWith("/dev/"))
device = specification.toLocal8Bit();