Fix Error in Device Pairing for ANT+ devices in TrainMode

... after making Wheelsize Settings athlete dependent
This commit is contained in:
Joern
2015-09-19 17:13:21 +02:00
parent 1a8d683303
commit dc19141997
2 changed files with 10 additions and 1 deletions

View File

@@ -25,7 +25,14 @@
ANTlocalController::ANTlocalController(TrainSidebar *parent, DeviceConfiguration *dc) : RealtimeController(parent, dc)
{
myANTlocal = new ANT (parent, dc, parent->context->athlete->cyclist);
// for Device Pairing the controller is called with parent = NULL
QString cyclist;
if (parent) {
cyclist = parent->context->athlete->cyclist;
} else {
cyclist = QString();
}
myANTlocal = new ANT (parent, dc, cyclist);
connect(myANTlocal, SIGNAL(foundDevice(int,int,int)), this, SIGNAL(foundDevice(int,int,int)));
connect(myANTlocal, SIGNAL(lostDevice(int)), this, SIGNAL(lostDevice(int)));
connect(myANTlocal, SIGNAL(searchTimeout(int)), this, SIGNAL(searchTimeout(int)));

View File

@@ -173,6 +173,8 @@ GSettings::setValue(QString key, QVariant value)
QVariant
GSettings::cvalue(QString athleteName, QString key, QVariant def) {
if (athleteName.isNull() || athleteName.isEmpty()) return def;
QString keyVar = QString(key);
if (newFormat) {
int store;