summaryrefslogtreecommitdiff
path: root/metawatch
diff options
context:
space:
mode:
Diffstat (limited to 'metawatch')
-rw-r--r--metawatch/metawatch.cpp10
-rw-r--r--metawatch/metawatchscanner.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp
index fe080e4..6f8edca 100644
--- a/metawatch/metawatch.cpp
+++ b/metawatch/metawatch.cpp
@@ -120,7 +120,13 @@ MetaWatch::MetaWatch(ConfigKey* settings, QObject* parent) :
MetaWatch::~MetaWatch()
{
- delete _paintEngine;
+ if (_socket) {
+ _socket->close();
+ delete _socket;
+ }
+ if (_paintEngine) {
+ delete _paintEngine;
+ }
}
QPaintEngine* MetaWatch::paintEngine() const
@@ -724,7 +730,7 @@ void MetaWatch::socketDisconnected()
timeToNextRetry = connectRetryTimes[_connectRetries];
_connectRetries++;
}
- qDebug() << "Backing off for " << timeToNextRetry << "seconds for next retry";
+ qDebug() << "Backing off for" << timeToNextRetry << "seconds for next retry";
_connectAlignedTimer->start(timeToNextRetry / 2, timeToNextRetry * 2);
if (_connectAlignedTimer->lastError() != QSystemAlignedTimer::NoError) {
// I would like to know why QtM couldn't _emulate_ here using a QTimer by itself.
diff --git a/metawatch/metawatchscanner.cpp b/metawatch/metawatchscanner.cpp
index 99ccc93..a34f71b 100644
--- a/metawatch/metawatchscanner.cpp
+++ b/metawatch/metawatchscanner.cpp
@@ -37,9 +37,11 @@ void MetaWatchScanner::handleDiscoveredService(const QBluetoothServiceInfo &info
qDebug() << "metawatch bluetooth scan found:" << deviceName;
if (deviceName.contains("Digital", Qt::CaseInsensitive)) {
foundInfo["driver"] = QString("metawatch-digital");
+ foundInfo["next-watchlet-button"] = QString("A");
emit watchFound(foundInfo);
} else if (deviceName.contains("Analog", Qt::CaseInsensitive)) {
foundInfo["driver"] = QString("metawatch-analog");
+ foundInfo["next-watchlet-button"] = QString("A");
emit watchFound(foundInfo);
} else {
qWarning() << "Unknown MetaWatch device found:" << deviceName;