summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@nokia.com>2011-02-04 09:53:08 +0000
committerRainer Keller <rainer.keller@nokia.com>2011-02-04 09:53:08 +0000
commit8722951e354aa80bf5da9f42e6192522210d491f (patch)
tree4c8f7fdcc1cc013be15619ab408db1aafe7ad2fe
parent8a85aa28e20446f77d1bfe0e6532fe0b914bbb13 (diff)
Prevent transmission of invalid location data
All input widgets are checked for valid input before sending it.
-rw-r--r--library/components/locationui.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/library/components/locationui.cpp b/library/components/locationui.cpp
index cce3b85..37c4c91 100644
--- a/library/components/locationui.cpp
+++ b/library/components/locationui.cpp
@@ -278,7 +278,18 @@ void LocationUi::setDisplayedSatelliteData(const LocationUi::SatelliteData &data
void LocationUi::emitLocationChange() const
{
- emit locationChanged(locationData());
+ if (mLatitudeEdit->hasAcceptableInput()
+ && mLongitudeEdit->hasAcceptableInput()
+ && mAltitudeEdit->hasAcceptableInput()
+ && mDirectionEdit->hasAcceptableInput()
+ && mGroundSpeedEdit->hasAcceptableInput()
+ && mVerticalSpeedEdit->hasAcceptableInput()
+ && mMagneticVariationEdit->hasAcceptableInput()
+ && mHorizontalAccuracyEdit->hasAcceptableInput()
+ && mVerticalAccuracyEdit->hasAcceptableInput()
+ && mTimeEdit->hasAcceptableInput()) {
+ emit locationChanged(locationData());
+ }
}
void LocationUi::emitSatelliteDataChange() const