--- a/qtmobility/examples/lightmaps/lightmaps.cpp Fri Apr 16 15:51:22 2010 +0300
+++ b/qtmobility/examples/lightmaps/lightmaps.cpp Mon May 03 13:18:40 2010 +0300
@@ -317,12 +317,10 @@
& QNetworkConfigurationManager::CanStartAndStopInterfaces);
// Is there default access point, use it
- QNetworkConfiguration cfg1 = manager.defaultConfiguration();
- if (!cfg1.isValid() || (!canStartIAP && cfg1.state() != QNetworkConfiguration::Active)) {
- m_networkSetupError = QString(tr("Avaliable Access Points not found."));
- m_normalMap = 0;
- m_largeMap = 0;
- QTimer::singleShot(0, this, SLOT(delayedInit()));
+ QTM_PREPEND_NAMESPACE(QNetworkConfiguration) cfg1 = manager.defaultConfiguration();
+ if (!cfg1.isValid() || (!canStartIAP && cfg1.state() != QTM_PREPEND_NAMESPACE(QNetworkConfiguration)::Active)) {
+ m_networkSetupError = QString(tr("This example requires networking, and no avaliable networks or access points could be found."));
+ QTimer::singleShot(0, this, SLOT(networkSetupError()));
return;
}
@@ -370,9 +368,14 @@
private slots:
+ void networkSetupError() {
+ QMessageBox::critical(this, tr("LightMaps"),
+ m_networkSetupError);
+ QTimer::singleShot(0, qApp, SLOT(quit()));
+ }
+
void networkSessionOpened() {
m_location = QGeoPositionInfoSource::createDefaultSource(this);
- m_location->setUpdateInterval(10000);
if (!m_location) {
QNmeaPositionInfoSource *nmeaLocation = new QNmeaPositionInfoSource(QNmeaPositionInfoSource::SimulationMode, this);
@@ -383,6 +386,8 @@
m_usingLogFile = true;
}
+ m_location->setUpdateInterval(10000);
+
connect(m_location,
SIGNAL(positionUpdated(QGeoPositionInfo)),
this,
@@ -396,11 +401,6 @@
m_location->stopUpdates();
}
- if (!m_networkSetupError.isEmpty()) {
- QMessageBox::information(this, tr("LightMaps"),
- m_networkSetupError);
- }
-
m_normalMap = new SlippyMap(m_session, m_location, this);
m_largeMap = new SlippyMap(m_session, m_location, this);