diff options
author | David Laing <david.laing@nokia.com> | 2010-01-28 11:14:59 +1000 |
---|---|---|
committer | David Laing <david.laing@nokia.com> | 2010-01-28 11:14:59 +1000 |
commit | c5ce8d5aa31eac7b3493ea4aa5a1910152f1caf1 (patch) | |
tree | 8ea7cac64d35d22052213b92cbecff55c17c4bbc | |
parent | 8adedb82629df868ebba964e8318326e67d72b81 (diff) |
Formatting fixes for location code.
31 files changed, 232 insertions, 222 deletions
diff --git a/src/location/dbuscomm_maemo_p.h b/src/location/dbuscomm_maemo_p.h index 40bd605e72..46492a2f62 100644 --- a/src/location/dbuscomm_maemo_p.h +++ b/src/location/dbuscomm_maemo_p.h @@ -73,12 +73,12 @@ private: void createUniqueName(); public: - enum cmds {CmdStart=1, CmdStop=2, CmdOneShot=3, CmdSetMethods=4,CmdSetInterval=8}; + enum cmds {CmdStart = 1, CmdStop = 2, CmdOneShot = 3, CmdSetMethods = 4, CmdSetInterval = 8}; DBusComm(); int init(); bool sendDBusRegister(); - int sessionConfigRequest(const int command, const int method, + int sessionConfigRequest(const int command, const int method, const int interval) const; int receiveDBusMessage(const QByteArray &message); // called by D-Bus server int receivePositionUpdate(const QGeoPositionInfo &update); // called by D-Bus server diff --git a/src/location/dbusserver_maemo_p.h b/src/location/dbusserver_maemo_p.h index 64f47b355c..3a4de36813 100644 --- a/src/location/dbusserver_maemo_p.h +++ b/src/location/dbusserver_maemo_p.h @@ -64,7 +64,7 @@ private: DBusComm* handler; public slots: - Q_NOREPLY void positionUpdate(const QByteArray &update); + Q_NOREPLY void positionUpdate(const QByteArray &update); Q_NOREPLY void currentSettings(const QGeoPositionInfoSource::PositioningMethod methods, const int interval); }; diff --git a/src/location/qgeoareamonitor.cpp b/src/location/qgeoareamonitor.cpp index 3340e45803..4dc55e9497 100644 --- a/src/location/qgeoareamonitor.cpp +++ b/src/location/qgeoareamonitor.cpp @@ -41,7 +41,7 @@ #include "qgeoareamonitor.h" #if defined(Q_OS_SYMBIAN) && defined(QT_LOCATION_S60_MONITORING) - #include "qgeoareamonitor_s60_p.h" +#include "qgeoareamonitor_s60_p.h" #endif /*! @@ -99,8 +99,8 @@ public: Creates a monitor with the given \a parent. */ QGeoAreaMonitor::QGeoAreaMonitor(QObject *parent) - : QObject(parent), - d(new QGeoAreaMonitorPrivate) + : QObject(parent), + d(new QGeoAreaMonitorPrivate) { d->radius = qreal(0.0); } diff --git a/src/location/qgeoareamonitor.h b/src/location/qgeoareamonitor.h index d6c06da764..fda59291ce 100644 --- a/src/location/qgeoareamonitor.h +++ b/src/location/qgeoareamonitor.h @@ -49,10 +49,11 @@ QT_BEGIN_HEADER #ifdef Q_QDOC -//normally we would use macro only but this causes some other compilation issues -QTM_BEGIN_NAMESPACE +//normally we would use macro only but this causes some other compilation issues +QTM_BEGIN_NAMESPACE #else -namespace QtMobility { +namespace QtMobility +{ #endif @@ -83,7 +84,7 @@ Q_SIGNALS: private: Q_DISABLE_COPY(QGeoAreaMonitor) QGeoAreaMonitorPrivate *d; -}; +}; } diff --git a/src/location/qgeoareamonitor_s60.cpp b/src/location/qgeoareamonitor_s60.cpp index cd5bf6eff9..5fcd198b27 100644 --- a/src/location/qgeoareamonitor_s60.cpp +++ b/src/location/qgeoareamonitor_s60.cpp @@ -75,7 +75,7 @@ void QGeoAreaMonitorS60::setMonitoredArea(const QGeoCoordinate & aCoordinate, qr //Intialize the trigger and enable the trigger if atleast one slot is connected to the areaEntered //signal - if ((iTriggerCreateAO->InitializeTrigger(this,EntryTrigger, coord, aRadius)) && + if ((iTriggerCreateAO->InitializeTrigger(this, EntryTrigger, coord, aRadius)) && (receivers(SIGNAL(areaEntered(const QGeoPositionInfo&))) > 0)) { iTriggerCreateAO->SetTriggerState(this, EntryTrigger, true); iTriggerAO->NotifyFiredEvent(); @@ -205,7 +205,7 @@ void QGeoAreaMonitorS60::TPositionInfoToQGeoPositionInfo(TPositionInfo& aPosInfo TDateTime datetime = pos.Time().DateTime(); QDateTime dt(QDate(datetime.Year(), datetime.Month() + 1, datetime.Day() + 1), QTime(datetime.Hour(), datetime.Minute(), datetime.Second(), - datetime.MicroSecond()/1000)); + datetime.MicroSecond() / 1000)); //store the time stamp aQInfo.setDateTime(dt); diff --git a/src/location/qgeoareamonitor_s60_p.h b/src/location/qgeoareamonitor_s60_p.h index 3fffa4f006..fcc7520273 100644 --- a/src/location/qgeoareamonitor_s60_p.h +++ b/src/location/qgeoareamonitor_s60_p.h @@ -61,7 +61,7 @@ QTM_BEGIN_NAMESPACE * */ class QGeoAreaMonitorS60 : public INotificationMonitorCallback, - public QGeoAreaMonitor + public QGeoAreaMonitor { public : diff --git a/src/location/qgeocoordinate.cpp b/src/location/qgeocoordinate.cpp index 1281e9e767..d3a0bb2d00 100644 --- a/src/location/qgeocoordinate.cpp +++ b/src/location/qgeocoordinate.cpp @@ -57,8 +57,14 @@ QTM_BEGIN_NAMESPACE static const double qgeocoordinate_EARTH_MEAN_RADIUS = 6371.0072; -inline static double qgeocoordinate_degToRad(double deg) { return deg * M_PI / 180; } -inline static double qgeocoordinate_radToDeg(double rad) { return rad * 180 / M_PI; } +inline static double qgeocoordinate_degToRad(double deg) +{ + return deg * M_PI / 180; +} +inline static double qgeocoordinate_radToDeg(double rad) +{ + return rad * 180 / M_PI; +} class QGeoCoordinatePrivate @@ -68,8 +74,7 @@ public: double lng; double alt; - QGeoCoordinatePrivate() - { + QGeoCoordinatePrivate() { lat = qQNaN(); lng = qQNaN(); alt = qQNaN(); @@ -121,7 +126,7 @@ public: setLatitude() and setLongitude() have been called. */ QGeoCoordinate::QGeoCoordinate() - : d(new QGeoCoordinatePrivate) + : d(new QGeoCoordinatePrivate) { } @@ -135,7 +140,7 @@ QGeoCoordinate::QGeoCoordinate() \sa isValid() */ QGeoCoordinate::QGeoCoordinate(double latitude, double longitude) - : d(new QGeoCoordinatePrivate) + : d(new QGeoCoordinatePrivate) { if (QLocationUtils::isValidLat(latitude) && QLocationUtils::isValidLong(longitude)) { d->lat = latitude; @@ -156,7 +161,7 @@ QGeoCoordinate::QGeoCoordinate(double latitude, double longitude) \sa isValid() */ QGeoCoordinate::QGeoCoordinate(double latitude, double longitude, double altitude) - : d(new QGeoCoordinatePrivate) + : d(new QGeoCoordinatePrivate) { if (QLocationUtils::isValidLat(latitude) && QLocationUtils::isValidLong(longitude)) { d->lat = latitude; @@ -169,7 +174,7 @@ QGeoCoordinate::QGeoCoordinate(double latitude, double longitude, double altitud Constructs a coordinate from the contents of \a other. */ QGeoCoordinate::QGeoCoordinate(const QGeoCoordinate &other) - : d(new QGeoCoordinatePrivate) + : d(new QGeoCoordinatePrivate) { operator=(other); } @@ -186,7 +191,7 @@ QGeoCoordinate::~QGeoCoordinate() Assigns \a other to this coordinate and returns a reference to this coordinate. */ -QGeoCoordinate &QGeoCoordinate::operator=(const QGeoCoordinate &other) +QGeoCoordinate &QGeoCoordinate::operator=(const QGeoCoordinate & other) { if (this == &other) return *this; @@ -204,9 +209,9 @@ QGeoCoordinate &QGeoCoordinate::operator=(const QGeoCoordinate &other) */ bool QGeoCoordinate::operator==(const QGeoCoordinate &other) const { - return ( (qIsNaN(d->lat) && qIsNaN(other.d->lat)) || qFuzzyCompare(d->lat, other.d->lat)) - && ( (qIsNaN(d->lng) && qIsNaN(other.d->lng)) || qFuzzyCompare(d->lng, other.d->lng)) - && ( (qIsNaN(d->alt) && qIsNaN(other.d->alt)) || qFuzzyCompare(d->alt, other.d->alt)); + return ((qIsNaN(d->lat) && qIsNaN(other.d->lat)) || qFuzzyCompare(d->lat, other.d->lat)) + && ((qIsNaN(d->lng) && qIsNaN(other.d->lng)) || qFuzzyCompare(d->lng, other.d->lng)) + && ((qIsNaN(d->alt) && qIsNaN(other.d->alt)) || qFuzzyCompare(d->alt, other.d->alt)); } /*! @@ -338,9 +343,9 @@ qreal QGeoCoordinate::distanceTo(const QGeoCoordinate &other) const double dlat = qgeocoordinate_degToRad(other.d->lat - d->lat); double dlon = qgeocoordinate_degToRad(other.d->lng - d->lng); double y = sin(dlat / 2.0) * sin(dlat / 2.0) - + cos(qgeocoordinate_degToRad(d->lat)) - * cos(qgeocoordinate_degToRad(other.d->lat)) - * sin(dlon / 2.0) * sin(dlon / 2.0); + + cos(qgeocoordinate_degToRad(d->lat)) + * cos(qgeocoordinate_degToRad(other.d->lat)) + * sin(dlon / 2.0) * sin(dlon / 2.0); double x = 2 * atan2(sqrt(y), sqrt(1 - y)); return qreal(x * qgeocoordinate_EARTH_MEAN_RADIUS * 1000); } @@ -423,45 +428,42 @@ QString QGeoCoordinate::toString(CoordinateFormat format) const switch (format) { case Degrees: - case DegreesWithHemisphere: - { + case DegreesWithHemisphere: { latStr = QString::number(absLat, 'f', 5) + symbol; longStr = QString::number(absLng, 'f', 5) + symbol; break; } case DegreesMinutes: - case DegreesMinutesWithHemisphere: - { + case DegreesMinutesWithHemisphere: { double latMin = (absLat - int(absLat)) * 60; double lngMin = (absLng - int(absLng)) * 60; latStr = QString("%1%2 %3'") - .arg(QString::number(int(absLat))) - .arg(symbol) - .arg(QString::number(latMin, 'f', 3)); + .arg(QString::number(int(absLat))) + .arg(symbol) + .arg(QString::number(latMin, 'f', 3)); longStr = QString("%1%2 %3'") - .arg(QString::number(int(absLng))) - .arg(symbol) - .arg(QString::number(lngMin, 'f', 3)); + .arg(QString::number(int(absLng))) + .arg(symbol) + .arg(QString::number(lngMin, 'f', 3)); break; } case DegreesMinutesSeconds: - case DegreesMinutesSecondsWithHemisphere: - { + case DegreesMinutesSecondsWithHemisphere: { double latMin = (absLat - int(absLat)) * 60; double lngMin = (absLng - int(absLng)) * 60; double latSec = (latMin - int(latMin)) * 60; double lngSec = (lngMin - int(lngMin)) * 60; latStr = QString("%1%2 %3' %4\"") - .arg(QString::number(int(absLat))) - .arg(symbol) - .arg(QString::number(int(latMin))) - .arg(QString::number(latSec, 'f', 1)); + .arg(QString::number(int(absLat))) + .arg(symbol) + .arg(QString::number(int(latMin))) + .arg(QString::number(latSec, 'f', 1)); longStr = QString("%1%2 %3' %4\"") - .arg(QString::number(int(absLng))) - .arg(symbol) - .arg(QString::number(int(lngMin))) - .arg(QString::number(lngSec, 'f', 1)); + .arg(QString::number(int(absLng))) + .arg(symbol) + .arg(QString::number(int(lngMin))) + .arg(QString::number(lngSec, 'f', 1)); break; } } @@ -470,8 +472,7 @@ QString QGeoCoordinate::toString(CoordinateFormat format) const switch (format) { case Degrees: case DegreesMinutes: - case DegreesMinutesSeconds: - { + case DegreesMinutesSeconds: { if (d->lat < 0) latStr.insert(0, "-"); if (d->lng < 0) @@ -480,8 +481,7 @@ QString QGeoCoordinate::toString(CoordinateFormat format) const } case DegreesWithHemisphere: case DegreesMinutesWithHemisphere: - case DegreesMinutesSecondsWithHemisphere: - { + case DegreesMinutesSecondsWithHemisphere: { if (d->lat < 0) latStr.append(" S"); else if (d->lat > 0) @@ -527,7 +527,7 @@ QDebug operator<<(QDebug dbg, const QGeoCoordinate &coord) #ifndef QT_NO_DATASTREAM /*! \fn QDataStream &operator<<(QDataStream &stream, const QGeoCoordinate &coordinate) - + \relates QGeoCoordinate Writes the given \a coordinate to the specified \a stream. diff --git a/src/location/qgeocoordinate.h b/src/location/qgeocoordinate.h index 0cd2c68aea..9a4902a0b8 100644 --- a/src/location/qgeocoordinate.h +++ b/src/location/qgeocoordinate.h @@ -82,7 +82,9 @@ public: QGeoCoordinate &operator=(const QGeoCoordinate &other); bool operator==(const QGeoCoordinate &other) const; - inline bool operator!=(const QGeoCoordinate &other) const { return !operator==(other); } + inline bool operator!=(const QGeoCoordinate &other) const { + return !operator==(other); + } bool isValid() const; CoordinateType type() const; diff --git a/src/location/qgeopositioninfo.cpp b/src/location/qgeopositioninfo.cpp index 8310e1db12..5cb639fbc4 100644 --- a/src/location/qgeopositioninfo.cpp +++ b/src/location/qgeopositioninfo.cpp @@ -84,7 +84,7 @@ public: \sa isValid() */ QGeoPositionInfo::QGeoPositionInfo() - : d(new QGeoPositionInfoPrivate) + : d(new QGeoPositionInfoPrivate) { } @@ -92,7 +92,7 @@ QGeoPositionInfo::QGeoPositionInfo() Creates a QGeoPositionInfo for the given \a coordinate and \a dateTime. */ QGeoPositionInfo::QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime &dateTime) - : d(new QGeoPositionInfoPrivate) + : d(new QGeoPositionInfoPrivate) { d->dateTime = dateTime; d->coord = coordinate; @@ -102,7 +102,7 @@ QGeoPositionInfo::QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDate Creates a QGeoPositionInfo with the values of \a other. */ QGeoPositionInfo::QGeoPositionInfo(const QGeoPositionInfo &other) - : d(new QGeoPositionInfoPrivate) + : d(new QGeoPositionInfoPrivate) { operator=(other); } @@ -118,7 +118,7 @@ QGeoPositionInfo::~QGeoPositionInfo() /*! Assigns the values from \a other to this QGeoPositionInfo. */ -QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo &other) +QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo & other) { if (this == &other) return *this; @@ -137,8 +137,8 @@ QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo &other) bool QGeoPositionInfo::operator==(const QGeoPositionInfo &other) const { return d->dateTime == other.d->dateTime - && d->coord == other.d->coord - && d->doubleAttribs == other.d->doubleAttribs; + && d->coord == other.d->coord + && d->doubleAttribs == other.d->doubleAttribs; } /*! diff --git a/src/location/qgeopositioninfo.h b/src/location/qgeopositioninfo.h index b393965fe6..0d6bee9c7b 100644 --- a/src/location/qgeopositioninfo.h +++ b/src/location/qgeopositioninfo.h @@ -76,7 +76,9 @@ public: QGeoPositionInfo &operator=(const QGeoPositionInfo &other); bool operator==(const QGeoPositionInfo &other) const; - inline bool operator!=(const QGeoPositionInfo &other) const { return !operator==(other); } + inline bool operator!=(const QGeoPositionInfo &other) const { + return !operator==(other); + } bool isValid() const; diff --git a/src/location/qgeopositioninfosource.cpp b/src/location/qgeopositioninfosource.cpp index 398eaccaea..239d327bfe 100644 --- a/src/location/qgeopositioninfosource.cpp +++ b/src/location/qgeopositioninfosource.cpp @@ -196,7 +196,7 @@ QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *par return ret; #elif defined(Q_OS_WINCE) return new QGeoPositionInfoSourceWinCE(parent); -#elif defined(Q_WS_MAEMO_6) +#elif defined(Q_WS_MAEMO_6) QGeoPositionInfoSourceMaemo *source = new QGeoPositionInfoSourceMaemo(parent); int status = source->init(); @@ -206,9 +206,9 @@ QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *par } return source; -#else - Q_UNUSED(parent); -#endif +#else + Q_UNUSED(parent); +#endif return 0; } @@ -249,10 +249,10 @@ QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *par If setUpdateInterval() has not been called, the source will emit updates as soon as they become available. - An updateTimout() signal will be emitted if this QGeoPositionInfoSource subclass determines - that it will not be able to provide regular updates. This could happen if a satelllite fix is - lost or if a hardware error is detected. Position updates will recommence if the data becomes - available later on. The updateTimout() signal will not be emitted again until after the + An updateTimout() signal will be emitted if this QGeoPositionInfoSource subclass determines + that it will not be able to provide regular updates. This could happen if a satelllite fix is + lost or if a hardware error is detected. Position updates will recommence if the data becomes + available later on. The updateTimout() signal will not be emitted again until after the periodic updates resume. */ @@ -294,11 +294,11 @@ QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *par /*! \fn void QGeoPositionInfoSource::updateTimeout(); - If requestUpdate() was called, this signal will be emitted if the current position could not + If requestUpdate() was called, this signal will be emitted if the current position could not be retrieved within the specified timeout. - If startUpdates() has been called, this signal will be emitted if this QGeoPositionInfoSource - subclass determines that it will not be able to provide further regular updates. This signal + If startUpdates() has been called, this signal will be emitted if this QGeoPositionInfoSource + subclass determines that it will not be able to provide further regular updates. This signal will not be emitted again until after the regular updates resume. */ diff --git a/src/location/qgeopositioninfosource_maemo.cpp b/src/location/qgeopositioninfosource_maemo.cpp index 31d758c195..4818c36bff 100644 --- a/src/location/qgeopositioninfosource_maemo.cpp +++ b/src/location/qgeopositioninfosource_maemo.cpp @@ -42,28 +42,28 @@ #include "qgeopositioninfosource_maemo_p.h" #include <iostream> -#if 0 +#if 0 void dumpQByteArray(const QByteArray &msg) { std::cout << "QByteArray dump:\n"; std::cout << msg.size() << " \n"; int i = msg.size(); - for(int k=0; k<i ;k++) - printf("msg[%d]=%2.2x\n",k,(unsigned char)msg[k]); + for (int k = 0; k < i ;k++) + printf("msg[%d]=%2.2x\n", k, (unsigned char)msg[k]); } -#endif +#endif using namespace std; QTM_BEGIN_NAMESPACE -QGeoPositionInfoSourceMaemo::QGeoPositionInfoSourceMaemo(QObject *parent):QGeoPositionInfoSource(parent) +QGeoPositionInfoSourceMaemo::QGeoPositionInfoSourceMaemo(QObject *parent): QGeoPositionInfoSource(parent) { // default values time_interval_ = 5000; distance_interval_ = 10; registered_ = false; - validLastUpdate = false; + validLastUpdate = false; validLastSatUpdate = false; availableMethods = AllPositioningMethods; } @@ -75,10 +75,10 @@ int QGeoPositionInfoSourceMaemo::init() dbusComm = new DBusComm(); status = dbusComm->init(); - QObject::connect(dbusComm, SIGNAL(receivedMessage(const QByteArray &)), + QObject::connect(dbusComm, SIGNAL(receivedMessage(const QByteArray &)), this, SLOT(dbusMessages(const QByteArray &))); - QObject::connect(dbusComm, SIGNAL(receivedPositionUpdate(const QGeoPositionInfo &)), + QObject::connect(dbusComm, SIGNAL(receivedPositionUpdate(const QGeoPositionInfo &)), this, SLOT(newPositionUpdate(const QGeoPositionInfo &))); return status; @@ -104,11 +104,11 @@ void QGeoPositionInfoSourceMaemo::newPositionUpdate(const QGeoPositionInfo &upda QGeoPositionInfo QGeoPositionInfoSourceMaemo::lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const { - if(validLastSatUpdate) + if (validLastSatUpdate) return lastSatUpdate; - if(!fromSatellitePositioningMethodsOnly) - if(validLastUpdate) + if (!fromSatellitePositioningMethodsOnly) + if (validLastUpdate) return lastUpdate; return QGeoPositionInfo(); @@ -123,7 +123,7 @@ QGeoPositionInfoSource::PositioningMethods QGeoPositionInfoSourceMaemo::supporte void QGeoPositionInfoSourceMaemo::setUpdateInterval(int msec) { - msec = (msec<MinimumUpdateInterval)?MinimumUpdateInterval:msec; + msec = (msec < MinimumUpdateInterval) ? MinimumUpdateInterval : msec; QGeoPositionInfoSource::setUpdateInterval(msec); if (registered_ == false) @@ -135,7 +135,7 @@ void QGeoPositionInfoSourceMaemo::setPreferredPositioningMethods(PositioningMeth { QGeoPositionInfoSource::setPreferredPositioningMethods(sources); if (registered_ == false) - registered_ = dbusComm->sendDBusRegister(); + registered_ = dbusComm->sendDBusRegister(); dbusComm->sessionConfigRequest(dbusComm->CmdSetMethods, sources, 0); } @@ -168,7 +168,7 @@ void QGeoPositionInfoSourceMaemo::stopUpdates() void QGeoPositionInfoSourceMaemo::requestUpdate(int timeout) { - if(timeout) {} + if (timeout) {} } #include "moc_qgeopositioninfosource_maemo_p.cpp" diff --git a/src/location/qgeopositioninfosource_s60.cpp b/src/location/qgeopositioninfosource_s60.cpp index f73283bb9f..eb5fac54b3 100644 --- a/src/location/qgeopositioninfosource_s60.cpp +++ b/src/location/qgeopositioninfosource_s60.cpp @@ -215,7 +215,7 @@ int CQGeoPositionInfoSourceS60::minimumUpdateInterval() const return 0; TInt i = checkModule(mCurrentModuleId); - if (i!= -1) + if (i != -1) return mList[i].mTimeToNextFix.Int64() / 1000; //divide by 1000, to convert microsecond to milisecond return 0; } @@ -421,7 +421,7 @@ void CQGeoPositionInfoSourceS60::updateStatus(TPositionModuleInfo aModInfo, TInt interval = QGeoPositionInfoSource::updateInterval(); TRAPD(ret, temp = CQMLBackendAO::NewL(this, RegularUpdate, - mList[i].mUid)); + mList[i].mUid)); if ((ret == KErrNone) && (temp != NULL)) { temp->setUpdateInterval(interval); @@ -469,12 +469,12 @@ void CQGeoPositionInfoSourceS60::updateStatus(TPositionModuleInfo aModInfo, TInt if (index >= 0) { TRAPD(ret, temp = CQMLBackendAO::NewL(this, RegularUpdate, - mList[index].mUid)); + mList[index].mUid)); if ((ret == KErrNone) && (temp != NULL)) break; - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } } while (index >= 0); @@ -501,7 +501,7 @@ void CQGeoPositionInfoSourceS60::updateStatus(TPositionModuleInfo aModInfo, TInt mCurrentModuleId = TUid::Null(); mCurrentMethod = PositioningMethod(0); QGeoPositionInfoSource::setPreferredPositioningMethods(mCurrentMethod); - emit updateTimeout(); + emit updateTimeout(); } } @@ -597,9 +597,9 @@ void CQGeoPositionInfoSourceS60::TPositionInfo2QGeoPositionInfo( aPosInfo2.setCoordinate(coord); TDateTime datetime = pos.Time().DateTime(); - QDateTime dt(QDate(datetime.Year() ,datetime.Month() + 1, datetime.Day() + 1), - QTime(datetime.Hour() ,datetime.Minute(), datetime.Second(), - datetime.MicroSecond()/1000)); + QDateTime dt(QDate(datetime.Year() , datetime.Month() + 1, datetime.Day() + 1), + QTime(datetime.Hour() , datetime.Minute(), datetime.Second(), + datetime.MicroSecond() / 1000)); //store the time stamp aPosInfo2.setDateTime(dt); @@ -708,7 +708,7 @@ void CQGeoPositionInfoSourceS60::requestUpdate(int aTimeout) return; } - TRAPD(ret, temp = CQMLBackendAO::NewL(this,OnceUpdate,mList[index].mUid)); + TRAPD(ret, temp = CQMLBackendAO::NewL(this, OnceUpdate, mList[index].mUid)); if ((ret == KErrNone) && (temp != NULL)) { //delete the old reqest update @@ -726,7 +726,7 @@ void CQGeoPositionInfoSourceS60::requestUpdate(int aTimeout) return; } - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } while (index >= 0); @@ -789,7 +789,7 @@ void CQGeoPositionInfoSourceS60::setPreferredPositioningMethods(PositioningMetho if (temp != NULL) break; - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } } while (index >= 0); diff --git a/src/location/qgeopositioninfosource_s60_p.h b/src/location/qgeopositioninfosource_s60_p.h index 7536dfc6c8..bca959c601 100644 --- a/src/location/qgeopositioninfosource_s60_p.h +++ b/src/location/qgeopositioninfosource_s60_p.h @@ -87,7 +87,7 @@ public: * */ class CQGeoPositionInfoSourceS60 : public INotificationCallback, - public QGeoPositionInfoSource + public QGeoPositionInfoSource { public: diff --git a/src/location/qgeosatelliteinfo.cpp b/src/location/qgeosatelliteinfo.cpp index 0381a79d81..00faa2aa91 100644 --- a/src/location/qgeosatelliteinfo.cpp +++ b/src/location/qgeosatelliteinfo.cpp @@ -75,7 +75,7 @@ public: Creates a satellite information object. */ QGeoSatelliteInfo::QGeoSatelliteInfo() - : d(new QGeoSatelliteInfoPrivate) + : d(new QGeoSatelliteInfoPrivate) { d->prn = -1; d->signal = -1; @@ -86,7 +86,7 @@ QGeoSatelliteInfo::QGeoSatelliteInfo() */ QGeoSatelliteInfo::QGeoSatelliteInfo(const QGeoSatelliteInfo &other) - : d(new QGeoSatelliteInfoPrivate) + : d(new QGeoSatelliteInfoPrivate) { operator=(other); } @@ -102,7 +102,7 @@ QGeoSatelliteInfo::~QGeoSatelliteInfo() /*! Assigns the values from \a other to this object. */ -QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(const QGeoSatelliteInfo &other) +QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(const QGeoSatelliteInfo & other) { if (this == &other) return *this; @@ -120,8 +120,8 @@ QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(const QGeoSatelliteInfo &other) bool QGeoSatelliteInfo::operator==(const QGeoSatelliteInfo &other) const { return d->prn == other.d->prn - && d->signal == other.d->signal - && d->doubleAttribs == other.d->doubleAttribs; + && d->signal == other.d->signal + && d->doubleAttribs == other.d->doubleAttribs; } /*! diff --git a/src/location/qgeosatelliteinfo.h b/src/location/qgeosatelliteinfo.h index 2813ed0e8c..92e4d42910 100644 --- a/src/location/qgeosatelliteinfo.h +++ b/src/location/qgeosatelliteinfo.h @@ -67,7 +67,9 @@ public: QGeoSatelliteInfo &operator=(const QGeoSatelliteInfo &other); bool operator==(const QGeoSatelliteInfo &other) const; - inline bool operator!=(const QGeoSatelliteInfo &other) const { return !operator==(other); } + inline bool operator!=(const QGeoSatelliteInfo &other) const { + return !operator==(other); + } void setPrnNumber(int prn); int prnNumber() const; diff --git a/src/location/qgeosatelliteinfosource.cpp b/src/location/qgeosatelliteinfosource.cpp index c7ccfc6df0..a75d32fea5 100644 --- a/src/location/qgeosatelliteinfosource.cpp +++ b/src/location/qgeosatelliteinfosource.cpp @@ -42,7 +42,7 @@ #if defined(Q_OS_SYMBIAN) # include "qgeosatelliteinfosource_s60_p.h" -#elif defined(Q_OS_WINCE) +#elif defined(Q_OS_WINCE) # include "qgeosatelliteinfosource_wince_p.h" #elif defined(Q_WS_MAEMO_6) # include "qgeosatelliteinfosource_maemo_p.h" @@ -65,7 +65,7 @@ QTM_BEGIN_NAMESPACE When an update is available, satellitesInViewUpdated() and/or satellitesInUseUpdated() will be emitted. - \warning On Windows CE it is not possible to detect if a device is GPS enabled. + \warning On Windows CE it is not possible to detect if a device is GPS enabled. The default satellite source on a Windows CE device without GPS support will never provide any satellite data. */ @@ -85,13 +85,13 @@ QGeoSatelliteInfoSource::QGeoSatelliteInfoSource(QObject *parent) */ QGeoSatelliteInfoSource *QGeoSatelliteInfoSource::createDefaultSource(QObject *parent) { -#if defined(Q_OS_SYMBIAN) - CQGeoSatelliteInfoSourceS60 *ret = NULL; +#if defined(Q_OS_SYMBIAN) + CQGeoSatelliteInfoSourceS60 *ret = NULL; TRAPD(error, ret = CQGeoSatelliteInfoSourceS60::NewL(parent)); return ret; #elif defined(Q_OS_WINCE) return new QGeoSatelliteInfoSourceWinCE(parent); -#elif defined(Q_WS_MAEMO_6) +#elif defined(Q_WS_MAEMO_6) QGeoSatelliteInfoSourceMaemo *source = new QGeoSatelliteInfoSourceMaemo(parent); int status = source->init(); diff --git a/src/location/qgeosatelliteinfosource_maemo.cpp b/src/location/qgeosatelliteinfosource_maemo.cpp index 2ac7e76338..a779098e09 100644 --- a/src/location/qgeosatelliteinfosource_maemo.cpp +++ b/src/location/qgeosatelliteinfosource_maemo.cpp @@ -54,8 +54,8 @@ int QGeoSatelliteInfoSourceMaemo::init() dbusComm = new DBusComm(); status = dbusComm->init(); - - QObject::connect(dbusComm, SIGNAL(npeMessage(const QByteArray &)), + + QObject::connect(dbusComm, SIGNAL(npeMessage(const QByteArray &)), this, SLOT(npeMessages(const QByteArray &))); return status; @@ -74,11 +74,11 @@ void QGeoSatelliteInfoSourceMaemo::dbusMessages(const QByteArray &msg) void QGeoSatelliteInfoSourceMaemo::startUpdates() { #if 0 - int len = npe.NewStartTrackingMsg(&msg,client_id_, NpeIf::MethodAll, + int len = npe.NewStartTrackingMsg(&msg, client_id_, NpeIf::MethodAll, NpeIf::OptionNone , 1); // cout << "ISI Message len " << len << "\n"; - dbusComm->sendIsiMessage(msg,len); + dbusComm->sendIsiMessage(msg, len); delete [] msg; #endif @@ -111,14 +111,14 @@ void QGeoSatelliteInfoSourceMaemo::stopUpdates() void QGeoSatelliteInfoSourceMaemo::requestUpdate(int timeout) { int a; - a = timeout +1; + a = timeout + 1; } #if 0 - void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites); - void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites); - void requestTimeout(); +void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites); +void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites); +void requestTimeout(); #endif #include "moc_qgeosatelliteinfosource_maemo_p.cpp" diff --git a/src/location/qgeosatelliteinfosource_s60.cpp b/src/location/qgeosatelliteinfosource_s60.cpp index 0db4fc7311..8cb6145885 100644 --- a/src/location/qgeosatelliteinfosource_s60.cpp +++ b/src/location/qgeosatelliteinfosource_s60.cpp @@ -141,12 +141,12 @@ void CQGeoSatelliteInfoSourceS60::ConstructL() if (index >= 0) { TRAPD(ret, temp = CQMLBackendAO::NewL(this, RegularUpdate, - mList[index].mUid)); + mList[index].mUid)); if ((ret == KErrNone) && (temp != NULL)) break; - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } } while (index >= 0); @@ -179,7 +179,7 @@ int CQGeoSatelliteInfoSourceS60::minimumUpdateInterval() const TInt i = checkModule(mCurrentModuleId); if (i != -1) - return mList[i].mTimeToNextFix.Int64()/1000; //divide by 1000, to convert microsecond to milisecond + return mList[i].mTimeToNextFix.Int64() / 1000; //divide by 1000, to convert microsecond to milisecond return 0; } @@ -320,7 +320,7 @@ void CQGeoSatelliteInfoSourceS60::updateStatus(TPositionModuleInfo aModInfo, TIn TInt interval = 0; TRAPD(ret, temp = CQMLBackendAO::NewL(this, RegularUpdate, - mList[i].mUid)); + mList[i].mUid)); if ((ret == KErrNone) && (temp != NULL)) { temp->setUpdateInterval(interval); @@ -362,12 +362,12 @@ void CQGeoSatelliteInfoSourceS60::updateStatus(TPositionModuleInfo aModInfo, TIn if (index >= 0) { TRAPD(ret, temp = CQMLBackendAO::NewL(this, RegularUpdate, - mList[index].mUid)); + mList[index].mUid)); if ((ret == KErrNone) && (temp != NULL)) break; - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } } while (index >= 0); @@ -470,11 +470,11 @@ void CQGeoSatelliteInfoSourceS60::TPositionSatelliteInfo2QGeoSatelliteInfo( QGeoSatelliteInfo qInfo; for (TInt i = 0; i < satInView; i++) { - aSatInfo.GetSatelliteData(i,satData); + aSatInfo.GetSatelliteData(i, satData); qInfo.setSignalStrength(satData.SignalStrength()); qInfo.setPrnNumber(satData.SatelliteId()); - qInfo.setAttribute(QGeoSatelliteInfo::Elevation,satData.Elevation()); - qInfo.setAttribute(QGeoSatelliteInfo::Azimuth,satData.Azimuth()); + qInfo.setAttribute(QGeoSatelliteInfo::Elevation, satData.Elevation()); + qInfo.setAttribute(QGeoSatelliteInfo::Azimuth, satData.Azimuth()); if (satData.IsUsed() == TRUE) { qListSatInUse.append(qInfo); } @@ -566,7 +566,7 @@ void CQGeoSatelliteInfoSourceS60::requestUpdate(int aTimeout) return; } - bits = bits & (0XFF ^ (1 << index)); + bits = bits & (0XFF ^(1 << index)); } while (index >= 0); diff --git a/src/location/qgeosatelliteinfosource_s60_p.h b/src/location/qgeosatelliteinfosource_s60_p.h index 99b3d9a408..29521b9773 100644 --- a/src/location/qgeosatelliteinfosource_s60_p.h +++ b/src/location/qgeosatelliteinfosource_s60_p.h @@ -83,7 +83,7 @@ public: * */ class CQGeoSatelliteInfoSourceS60 : public INotificationSatelliteCallback, - public QGeoSatelliteInfoSource + public QGeoSatelliteInfoSource { public: diff --git a/src/location/qlocationutils.cpp b/src/location/qlocationutils.cpp index 5ea2bdf4b7..b50bbbc105 100644 --- a/src/location/qlocationutils.cpp +++ b/src/location/qlocationutils.cpp @@ -310,7 +310,7 @@ bool QLocationUtils::getNmeaTime(const QByteArray &bytes, QTime *time) tempTime = QTime::fromString(bytes.mid(0, dotIndex), "hhmmss"); bool hasMsecs = false; int midLen = qMin(3, bytes.size() - dotIndex - 1); - int msecs = bytes.mid(dotIndex+1, midLen).toUInt(&hasMsecs); + int msecs = bytes.mid(dotIndex + 1, midLen).toUInt(&hasMsecs); if (hasMsecs) tempTime = tempTime.addMSecs(msecs); } diff --git a/src/location/qlocationutils_p.h b/src/location/qlocationutils_p.h index 20c01d1554..f705afc9cf 100644 --- a/src/location/qlocationutils_p.h +++ b/src/location/qlocationutils_p.h @@ -65,8 +65,12 @@ class QGeoPositionInfo; class QLocationUtils { public: - inline static bool isValidLat(double lat) { return lat >= -90 && lat <= 90; } - inline static bool isValidLong(double lng) { return lng >= -180 && lng <= 180; } + inline static bool isValidLat(double lat) { + return lat >= -90 && lat <= 90; + } + inline static bool isValidLong(double lng) { + return lng >= -180 && lng <= 180; + } /* Creates a QGeoPositionInfo from a GGA, GLL, RMC, VTG or ZDA sentence. diff --git a/src/location/qmlbackendao_s60.cpp b/src/location/qmlbackendao_s60.cpp index 5b1647dec0..c361845edc 100644 --- a/src/location/qmlbackendao_s60.cpp +++ b/src/location/qmlbackendao_s60.cpp @@ -380,8 +380,8 @@ void CQMLBackendAO::handlePosUpdateNotification(int aError) } if (mRequester) { - mRequester->updatePosition(positionInfo, aError); - delete positionInfo; + mRequester->updatePosition(positionInfo, aError); + delete positionInfo; } else { if ((aError != KErrTimedOut) || (mRequestType != RegularUpdate)) { mRequesterSatellite->updatePosition(satInfo, aError, (mRequestType == RegularUpdate)); diff --git a/src/location/qmlbackendmonitorao_s60.cpp b/src/location/qmlbackendmonitorao_s60.cpp index 843bfe3df9..bf13557faa 100644 --- a/src/location/qmlbackendmonitorao_s60.cpp +++ b/src/location/qmlbackendmonitorao_s60.cpp @@ -146,7 +146,7 @@ void QMLBackendMonitorAO::ConstructL(RLbtServer &aLbtServ) } QMLBackendMonitorAO::QMLBackendMonitorAO() - :CActive(EPriorityStandard), // Standard priority + : CActive(EPriorityStandard), // Standard priority subsessionCreated(FALSE) { CActiveScheduler::Add(this); diff --git a/src/location/qmlbackendmonitorcreatetriggerao_s60.cpp b/src/location/qmlbackendmonitorcreatetriggerao_s60.cpp index ef17bd85a0..f9398fe173 100644 --- a/src/location/qmlbackendmonitorcreatetriggerao_s60.cpp +++ b/src/location/qmlbackendmonitorcreatetriggerao_s60.cpp @@ -91,14 +91,14 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP CLbtGeoCircle* trigArea = NULL; TRAP(ret, trigArea = CLbtGeoCircle::NewL( - aCoordinate ,//center coordinate - aRadius //radius in meters. If - //NaN is used, Location - //Triggering Server will - //use minimal size of trigger - //area as the radius of the - //trigger - )); + aCoordinate ,//center coordinate + aRadius //radius in meters. If + //NaN is used, Location + //Triggering Server will + //use minimal size of trigger + //area as the radius of the + //trigger + )); if ((ret != KErrNone) || !trigArea) return FALSE; @@ -110,14 +110,14 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP if (aType == EntryTrigger) { //2: Construct a entry type of trigger condition TRAP(ret, cond = CLbtTriggerConditionArea::NewL( - trigArea, - CLbtTriggerConditionArea::EFireOnEnter - )); + trigArea, + CLbtTriggerConditionArea::EFireOnEnter + )); } else if (aType == ExitTrigger) { TRAP(ret, cond = CLbtTriggerConditionArea::NewL( - trigArea, - CLbtTriggerConditionArea::EFireOnExit - )); + trigArea, + CLbtTriggerConditionArea::EFireOnExit + )); } @@ -149,10 +149,10 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP CRequestor *req = NULL; TRAP(ret, req = CRequestor::NewL( - CRequestorBase::ERequestorService, - CRequestorBase::EFormatApplication, - KMyRequestorName - )); + CRequestorBase::ERequestorService, + CRequestorBase::EFormatApplication, + KMyRequestorName + )); if ((ret != KErrNone) || !req) { CleanupStack::PopAndDestroy(&reqStack); @@ -177,12 +177,12 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP CLbtSessionTrigger* trig = NULL; TRAP(ret, trig = CLbtSessionTrigger::NewL( - triggerName, - CLbtTriggerEntry::EStateDisabled, - reqStack, - managerUid, - cond - )); + triggerName, + CLbtTriggerEntry::EStateDisabled, + reqStack, + managerUid, + cond + )); CleanupStack::PopAndDestroy(&reqStack); @@ -203,7 +203,7 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP TRAP(ret, iActiveSchedulerwait = new(ELeave) CActiveSchedulerWait); - if ((ret !=KErrNone) || !iActiveSchedulerwait) { + if ((ret != KErrNone) || !iActiveSchedulerwait) { CleanupStack::PopAndDestroy(trig); return FALSE; } @@ -235,14 +235,14 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP CLbtGeoCircle* trigArea = NULL; TRAP(ret, trigArea = CLbtGeoCircle::NewL( - aCoordinate , //center coordinate - aRadius //radius in meters. If - //NaN is used, Location - //Triggering Server will - //use minimal size of trigger - //area as the radius of the - //trigger - )); + aCoordinate , //center coordinate + aRadius //radius in meters. If + //NaN is used, Location + //Triggering Server will + //use minimal size of trigger + //area as the radius of the + //trigger + )); if ((ret != KErrNone) || (!trigArea)) { @@ -257,14 +257,14 @@ bool QMLBackendMonitorCreateTriggerAO::InitializeTrigger(QGeoAreaMonitorS60* aP if (aType == EntryTrigger) { //2: Construct a entry type of trigger condition TRAP(ret, cond = CLbtTriggerConditionArea::NewL( - trigArea, - CLbtTriggerConditionArea::EFireOnEnter - )); + trigArea, + CLbtTriggerConditionArea::EFireOnEnter + )); } else if (aType == ExitTrigger) { TRAP(ret, cond = CLbtTriggerConditionArea::NewL( - trigArea, - CLbtTriggerConditionArea::EFireOnExit - )); + trigArea, + CLbtTriggerConditionArea::EFireOnExit + )); } diff --git a/src/location/qmlbackendmonitorcreatetriggerao_s60_p.h b/src/location/qmlbackendmonitorcreatetriggerao_s60_p.h index 8f591efb84..8010cdb650 100644 --- a/src/location/qmlbackendmonitorcreatetriggerao_s60_p.h +++ b/src/location/qmlbackendmonitorcreatetriggerao_s60_p.h @@ -69,7 +69,7 @@ public : void RunL(); - void SetTriggerState(QGeoAreaMonitorS60* aParent,enTriggerType aType,bool aStatus); + void SetTriggerState(QGeoAreaMonitorS60* aParent, enTriggerType aType, bool aStatus); TInt getRadius(qreal& radius); diff --git a/src/location/qmlbackendmonitorinfo_s60.cpp b/src/location/qmlbackendmonitorinfo_s60.cpp index b052b12038..f9fc4fafaa 100644 --- a/src/location/qmlbackendmonitorinfo_s60.cpp +++ b/src/location/qmlbackendmonitorinfo_s60.cpp @@ -79,7 +79,7 @@ CMonitorTriggerInfo* CBackendMonitorInfo::getMonitorTriggerInfo(QGeoAreaMonitorS } //creates and adds a new CMonitorTriggerInfo object to the end of linked list -bool CBackendMonitorInfo::addMonitorTriggerInfo(QGeoAreaMonitorS60* aParent,TLbtTriggerId aTriggerID, enTriggerType aType) +bool CBackendMonitorInfo::addMonitorTriggerInfo(QGeoAreaMonitorS60* aParent, TLbtTriggerId aTriggerID, enTriggerType aType) { CMonitorTriggerInfo* currentNode = NULL; diff --git a/src/location/qmlbackendtriggerchangeao_s60.cpp b/src/location/qmlbackendtriggerchangeao_s60.cpp index 39e7264c5b..11984d24b6 100644 --- a/src/location/qmlbackendtriggerchangeao_s60.cpp +++ b/src/location/qmlbackendtriggerchangeao_s60.cpp @@ -60,7 +60,7 @@ TInt QMLBackendTriggerChangeAO::refCount = 0; void QMLBackendTriggerChangeAO::NotifyChangeEvent() { if (!IsActive()) { - iStatue = KRequestPending; + iStatue = KRequestPending; iLbt.NotifyTriggerChangeEvent(iTriggerChangeEvent, iStatus); SetActive(); } @@ -139,7 +139,7 @@ void QMLBackendTriggerChangeAO::RunL() //exit trigger in the linked list if (triggerInfo1->iType == EntryTrigger) triggerInfo3 = iTriggerMonitorInfo->getMonitorTriggerInfo( - triggerInfo1->iParent ,ExitTrigger); + triggerInfo1->iParent , ExitTrigger); //if triggerinfo1->triggerid is found in the trigger list, //and if it is an entry trigger, search for the corresponding diff --git a/src/location/qnmeapositioninfosource.cpp b/src/location/qnmeapositioninfosource.cpp index 97caff260a..42041c2b7d 100644 --- a/src/location/qnmeapositioninfosource.cpp +++ b/src/location/qnmeapositioninfosource.cpp @@ -50,7 +50,7 @@ QTM_BEGIN_NAMESPACE QNmeaRealTimeReader::QNmeaRealTimeReader(QNmeaPositionInfoSourcePrivate *sourcePrivate) - : QNmeaReader(sourcePrivate) + : QNmeaReader(sourcePrivate) { } @@ -62,7 +62,7 @@ void QNmeaRealTimeReader::readAvailableData() char buf[1024]; qint64 size = m_proxy->m_device->readLine(buf, sizeof(buf)); while (size > 0) { - if (m_proxy->parsePosInfoFromNmeaData(buf, size, &update, &hasFix)) + if (m_proxy->parsePosInfoFromNmeaData(buf, size, &update, &hasFix)) m_proxy->notifyNewUpdate(&update, hasFix); memset(buf, 0, size); size = m_proxy->m_device->readLine(buf, sizeof(buf)); @@ -73,9 +73,9 @@ void QNmeaRealTimeReader::readAvailableData() //============================================================ QNmeaSimulatedReader::QNmeaSimulatedReader(QNmeaPositionInfoSourcePrivate *sourcePrivate) - : QNmeaReader(sourcePrivate), - m_currTimerId(-1), - m_hasValidDateTime(false) + : QNmeaReader(sourcePrivate), + m_currTimerId(-1), + m_hasValidDateTime(false) { } @@ -196,15 +196,15 @@ void QNmeaSimulatedReader::processNextSentence() QNmeaPositionInfoSourcePrivate::QNmeaPositionInfoSourcePrivate(QNmeaPositionInfoSource *parent) - : QObject(parent), - m_invokedStart(false), - m_source(parent), - m_nmeaReader(0), - m_updateTimer(0), - m_requestTimer(0), - m_noUpdateLastInterval(false), - m_updateTimeoutSent(false), - m_connectedReadyRead(false) + : QObject(parent), + m_invokedStart(false), + m_source(parent), + m_nmeaReader(0), + m_updateTimer(0), + m_requestTimer(0), + m_noUpdateLastInterval(false), + m_updateTimeoutSent(false), + m_connectedReadyRead(false) { } @@ -275,8 +275,8 @@ void QNmeaPositionInfoSourcePrivate::prepareSourceDevice() } } -bool QNmeaPositionInfoSourcePrivate::parsePosInfoFromNmeaData(const char *data, int size, - QGeoPositionInfo *posInfo, bool *hasFix) +bool QNmeaPositionInfoSourcePrivate::parsePosInfoFromNmeaData(const char *data, int size, + QGeoPositionInfo *posInfo, bool *hasFix) { return m_source->parsePosInfoFromNmeaData(data, size, posInfo, hasFix); } @@ -395,7 +395,7 @@ void QNmeaPositionInfoSourcePrivate::notifyNewUpdate(QGeoPositionInfo *update, b void QNmeaPositionInfoSourcePrivate::timerEvent(QTimerEvent *) { - emitPendingUpdate(); + emitPendingUpdate(); } void QNmeaPositionInfoSourcePrivate::emitPendingUpdate() @@ -405,12 +405,12 @@ void QNmeaPositionInfoSourcePrivate::emitPendingUpdate() m_noUpdateLastInterval = false; emitUpdated(m_pendingUpdate); m_pendingUpdate = QGeoPositionInfo(); - } else { + } else { if (m_noUpdateLastInterval && !m_updateTimeoutSent) { m_updateTimeoutSent = true; m_pendingUpdate = QGeoPositionInfo(); emit m_source->updateTimeout(); - } + } m_noUpdateLastInterval = true; } } @@ -439,12 +439,12 @@ void QNmeaPositionInfoSourcePrivate::emitUpdated(const QGeoPositionInfo &update) previously recorded NMEA data. The source of NMEA data is set with setDevice(). - - Use startUpdates() to start receiving regular position updates and stopUpdates() to stop these - updates. If you only require updates occasionally, you can call requestUpdate() to request a + + Use startUpdates() to start receiving regular position updates and stopUpdates() to stop these + updates. If you only require updates occasionally, you can call requestUpdate() to request a single update. - - In both cases the position information is received via the positionUpdated() signal and the + + In both cases the position information is received via the positionUpdated() signal and the last known position can be accessed with lastKnownPosition(). */ @@ -463,8 +463,8 @@ void QNmeaPositionInfoSourcePrivate::emitUpdated(const QGeoPositionInfo &update) and \a updateMode. */ QNmeaPositionInfoSource::QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent) - : QGeoPositionInfoSource(parent), - d(new QNmeaPositionInfoSourcePrivate(this)) + : QGeoPositionInfoSource(parent), + d(new QNmeaPositionInfoSourcePrivate(this)) { d->m_updateMode = updateMode; d->m_device = 0; @@ -480,20 +480,20 @@ QNmeaPositionInfoSource::~QNmeaPositionInfoSource() /*! Parses an NMEA sentence string into a QGeoPositionInfo. - + The default implementation will parse standard NMEA sentences. - This method should be reimplemented in a subclass whenever the need to deal with non-standard - NMEA sentences arises. - - The parser reads \a size bytes from \a data and uses that information to setup \a posInfo and - \a hasFix. If \a hasFix is set to false then \a posInfo may contain only the time or the date + This method should be reimplemented in a subclass whenever the need to deal with non-standard + NMEA sentences arises. + + The parser reads \a size bytes from \a data and uses that information to setup \a posInfo and + \a hasFix. If \a hasFix is set to false then \a posInfo may contain only the time or the date and the time. - Returns true if the sentence was succsesfully parsed, otherwise returns false and should not + Returns true if the sentence was succsesfully parsed, otherwise returns false and should not modifiy \a posInfo or \a hasFix. */ bool QNmeaPositionInfoSource::parsePosInfoFromNmeaData(const char *data, int size, - QGeoPositionInfo *posInfo, bool *hasFix) + QGeoPositionInfo *posInfo, bool *hasFix) { return QLocationUtils::getPosInfoFromNmea(data, size, posInfo, hasFix); } diff --git a/src/location/qnmeapositioninfosource.h b/src/location/qnmeapositioninfosource.h index daaec7679f..25fef129e6 100644 --- a/src/location/qnmeapositioninfosource.h +++ b/src/location/qnmeapositioninfosource.h @@ -82,10 +82,10 @@ public Q_SLOTS: void requestUpdate(int timeout = 0); protected: - virtual bool parsePosInfoFromNmeaData(const char *data, - int size, - QGeoPositionInfo *posInfo, - bool *hasFix); + virtual bool parsePosInfoFromNmeaData(const char *data, + int size, + QGeoPositionInfo *posInfo, + bool *hasFix); private: Q_DISABLE_COPY(QNmeaPositionInfoSource) diff --git a/src/location/qnmeapositioninfosource_p.h b/src/location/qnmeapositioninfosource_p.h index 0c1fd49fc6..6efd7a568b 100644 --- a/src/location/qnmeapositioninfosource_p.h +++ b/src/location/qnmeapositioninfosource_p.h @@ -70,8 +70,7 @@ QT_BEGIN_HEADER QTM_BEGIN_NAMESPACE class QNmeaReader; -struct QPendingGeoPositionInfo -{ +struct QPendingGeoPositionInfo { QGeoPositionInfo info; bool hasFix; }; @@ -88,10 +87,10 @@ public: void stopUpdates(); void requestUpdate(int msec); - bool parsePosInfoFromNmeaData(const char *data, - int size, - QGeoPositionInfo *posInfo, - bool *hasFix); + bool parsePosInfoFromNmeaData(const char *data, + int size, + QGeoPositionInfo *posInfo, + bool *hasFix); void notifyNewUpdate(QGeoPositionInfo *update, bool fixStatus); @@ -133,7 +132,7 @@ class QNmeaReader { public: explicit QNmeaReader(QNmeaPositionInfoSourcePrivate *sourcePrivate) - : m_proxy(sourcePrivate) {} + : m_proxy(sourcePrivate) {} virtual ~QNmeaReader() {} virtual void readAvailableData() = 0; |