qtmobility/src/sensors/qsensormanager.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
--- a/qtmobility/src/sensors/qsensormanager.cpp	Fri Jun 11 14:26:25 2010 +0300
+++ b/qtmobility/src/sensors/qsensormanager.cpp	Wed Jun 23 19:08:38 2010 +0300
@@ -160,7 +160,7 @@
         //SENSORLOG() << "factory" << QString().sprintf("0x%08x", (unsigned int)factory);
         sensor->setIdentifier(defaultIdentifier); // the factory requires this
         backend = factory->createBackend(sensor);
-        if (backend) goto gotbackend; // Got it!
+        if (backend) return backend; // Got it!
 
         // The default failed to instantiate so try any other registered sensors for this type
         Q_FOREACH (const QByteArray &identifier, factoryByIdentifier.keys()) {
@@ -170,7 +170,7 @@
             //SENSORLOG() << "factory" << QString().sprintf("0x%08x", (unsigned int)factory);
             sensor->setIdentifier(identifier); // the factory requires this
             backend = factory->createBackend(sensor);
-            if (backend) goto gotbackend; // Got it!
+            if (backend) return backend; // Got it!
         }
         SENSORLOG() << "FAILED";
         sensor->setIdentifier(QByteArray()); // clear the identifier
@@ -184,17 +184,11 @@
         factory = factoryByIdentifier[sensor->identifier()];
         //SENSORLOG() << "factory" << QString().sprintf("0x%08x", (unsigned int)factory);
         backend = factory->createBackend(sensor);
-        if (backend) goto gotbackend; // Got it!
+        if (backend) return backend; // Got it!
     }
 
     SENSORLOG() << "no suitable backend found for requested identifier" << sensor->identifier() << "and type" << sensor->type();
     return 0;
-
-gotbackend:
-    if (sensor->availableDataRates().count() != 0 && sensor->dataRate() == 0) {
-        qWarning() << sensor->identifier() << "backend did not supply default data rate.";
-    }
-    return backend;
 }
 
 // =====================================================================