qtmobility/src/sensors/qsensorbackend.cpp
changeset 5 453da2cfceef
parent 4 90517678cc4f
child 8 71781823f776
equal deleted inserted replaced
4:90517678cc4f 5:453da2cfceef
   233 {
   233 {
   234     if (!otherSensor) {
   234     if (!otherSensor) {
   235         qWarning() << "ERROR: Cannot call QSensorBackend::setDataRates with 0";
   235         qWarning() << "ERROR: Cannot call QSensorBackend::setDataRates with 0";
   236         return;
   236         return;
   237     }
   237     }
   238     if (otherSensor->identifier().count() == 0) {
   238     if (otherSensor->identifier().isEmpty()) {
   239         qWarning() << "ERROR: Cannot call QSensorBackend::setDataRates with an invalid sensor";
   239         qWarning() << "ERROR: Cannot call QSensorBackend::setDataRates with an invalid sensor";
   240         return;
   240         return;
   241     }
   241     }
   242     QSensorPrivate *d = m_sensor->d_func();
   242     QSensorPrivate *d = m_sensor->d_func();
   243     d->availableDataRates = otherSensor->availableDataRates();
   243     d->availableDataRates = otherSensor->availableDataRates();
   244     d->dataRate = otherSensor->dataRate();
   244     d->dataRate = otherSensor->dataRate();
   245     if (d->availableDataRates.count() == 0) {
       
   246         qWarning() << otherSensor->identifier() << "backend does not support any data rates.";
       
   247     }
       
   248 }
   245 }
   249 
   246 
   250 /*!
   247 /*!
   251     Add an output range (consisting of \a min, \a max values and \a accuracy) for the sensor.
   248     Add an output range (consisting of \a min, \a max values and \a accuracy) for the sensor.
   252 
   249