diff options
-rw-r--r-- | plugins/dbus/abstractproperty.h | 2 | ||||
-rw-r--r-- | plugins/dbus/varianttype.cpp | 3 | ||||
-rw-r--r-- | plugins/gpsd/gpsdplugin.cpp | 18 |
3 files changed, 21 insertions, 2 deletions
diff --git a/plugins/dbus/abstractproperty.h b/plugins/dbus/abstractproperty.h index 41d4f0ca..67b4ee07 100644 --- a/plugins/dbus/abstractproperty.h +++ b/plugins/dbus/abstractproperty.h @@ -78,6 +78,8 @@ public: { if(mValue) delete mValue; + //if(!val) return; + mValue = val->copy(); mAnyValue = val->anyValue(); mTimestamp = val->timestamp; diff --git a/plugins/dbus/varianttype.cpp b/plugins/dbus/varianttype.cpp index acde5e37..5f568534 100644 --- a/plugins/dbus/varianttype.cpp +++ b/plugins/dbus/varianttype.cpp @@ -57,7 +57,8 @@ void VariantType::fromGVariant(GVariant *val) void VariantType::asyncReply(AsyncPropertyReply * reply) { - setValue(reply->value); + if(reply->success) + setValue(reply->value); delete reply; } diff --git a/plugins/gpsd/gpsdplugin.cpp b/plugins/gpsd/gpsdplugin.cpp index b3432f2a..742901c3 100644 --- a/plugins/gpsd/gpsdplugin.cpp +++ b/plugins/gpsd/gpsdplugin.cpp @@ -50,22 +50,38 @@ static int updateGpsposition(gpointer data) double time = amb::currentTime(); + bool changed = false; + if(shared->gps.fix.mode > 2) { if(shared->gps.fix.latitude != shared->oldlat) + { shared->oldlat = shared->gps.fix.latitude; + changed |= true; + } if(shared->gps.fix.longitude != shared->oldlon) + { shared->oldlon = shared->gps.fix.longitude; + changed |= true; + } if(shared->gps.fix.altitude != shared->oldalt) + { shared->oldalt = shared->gps.fix.altitude; + changed |= true; + } if(shared->gps.fix.track != shared->oldheading) + { shared->oldheading = shared->gps.fix.track; + changed |= true; + } if(shared->gps.fix.speed * MPS_TO_KPH != shared->oldspeed) { shared->oldspeed = shared->gps.fix.speed * MPS_TO_KPH; + changed |= true; } - shared->parent->updateProperty(); + if(changed) + shared->parent->updateProperty(); } return 1; |