Logo Search packages:      
Sourcecode: kcm-tablet version File versions  Download package

bool DeviceHandler::findUSBDevice (  )  [private]

Looks for connected tablet devices via lsusb Updates the internal identifier for the company/device name

Returns:
true if a device was found false if not

Definition at line 143 of file devicehandler.cpp.

References detectDeviceInformation().

Referenced by detectTablet().

{
    // read lsusb
    QProcess lsusb;
    lsusb.start("lsusb");
    lsusb.waitForStarted();
    lsusb.waitForFinished();

    while (!lsusb.atEnd()) {
        QRegExp rxlen("ID\\s(.{4}):(.{4})");
        int pos = rxlen.indexIn(lsusb.readLine());
        if (pos > -1) {
            if (detectDeviceInformation(rxlen.cap(1), rxlen.cap(2))) {
                return true;
            }
        }
    }

    return false;
}


Generated by  Doxygen 1.6.0   Back to index