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

bool DeviceHandler::detectDeviceInformation ( const QString &  companyId,
const QString &  deviceId 
) [private]

Checks if there is some information available for the company ID and device ID The information is looked up in the corresponding lists in the data directory

companyId id string of the company in hex
deviceId id string of the tablet device in hex
true if the lookup for both was successfully false if the lookup failed

Definition at line 402 of file devicehandler.cpp.

Referenced by findSerialDevice(), and findUSBDevice().

    KConfigGroup companyGroup = KConfigGroup(d->companyConfig, companyId);

    if (companyGroup.keyList().isEmpty()) {
        //kDebug() << "no company information found for ID: " << companyId;
        return false;

    // read the company name and the datafile for the device information
    KSharedConfig::Ptr deviceConfig = KSharedConfig::openConfig(KStandardDirs::locate("data", QString("kcmtablet/data/%1").arg(companyGroup.readEntry("listfile"))), KConfig::SimpleConfig, "data");

    if (deviceConfig->groupList().isEmpty()) {
        kError() << "device list missing for company ID: " << companyId;
        return false;

    KConfigGroup deviceGroup = KConfigGroup(deviceConfig, deviceId.toUpper());

    if (deviceGroup.keyList().isEmpty()) {
        kDebug() << "device info not found for device ID: " << deviceId << " :: company" << companyGroup.readEntry("name");
        return false;

    // ok we found a list to the corresponding company id and a device that fits
    d->deviceId = deviceId.toUpper();
    d->companyId = companyId;

    return true;

Generated by  Doxygen 1.6.0   Back to index