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

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

Sets some basic information about the connected device from the config files. The files are stored in the data directory. They will give us the information about the tablet capabilities.

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

Definition at line 434 of file devicehandler.cpp.

References selectDeviceBackend().

Referenced by detectTablet().

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

    // 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");

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

    d->companyName = companyGroup.readEntry("name");
    d->deviceModel = deviceGroup.readEntry("model");
    d->deviceName = deviceGroup.readEntry("name");

    if (deviceGroup.readEntry("padbuttons")  != QString('0') ||
            deviceGroup.readEntry("wheel")       != QString("no") ||
            deviceGroup.readEntry("touchring")   != QString("no") ||
            deviceGroup.readEntry("touchstripl") != QString("no") ||
            deviceGroup.readEntry("touchstripr") != QString("no")) {
        d->hasPadButtons = true;
    } else {
        d->hasPadButtons = false;

    return true;

Generated by  Doxygen 1.6.0   Back to index