diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-09-02 20:53:05 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-09-02 20:53:05 +0200 |
commit | 2f631362b54180252d0daa34f359338860a8782b (patch) | |
tree | 86148bee6e0b09e2c68a8166fc2b6143f22d7949 /metawatch/metawatchdigitalsimulator.cpp | |
parent | 3e5440a3e1d4f23180b8e6795ae1c29f9964379d (diff) | |
download | sowatch-2f631362b54180252d0daa34f359338860a8782b.tar.gz sowatch-2f631362b54180252d0daa34f359338860a8782b.zip |
fixing a few warnings
Diffstat (limited to 'metawatch/metawatchdigitalsimulator.cpp')
-rw-r--r-- | metawatch/metawatchdigitalsimulator.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/metawatch/metawatchdigitalsimulator.cpp b/metawatch/metawatchdigitalsimulator.cpp index 5c399bd..e5cd74b 100644 --- a/metawatch/metawatchdigitalsimulator.cpp +++ b/metawatch/metawatchdigitalsimulator.cpp @@ -19,10 +19,12 @@ MetaWatchDigitalSimulator::MetaWatchDigitalSimulator(ConfigKey *config, QObject _form->showNormal(); connect(_form, SIGNAL(buttonPressed(int)), SIGNAL(buttonPressed(int))); connect(_form, SIGNAL(buttonReleased(int)), SIGNAL(buttonReleased(int))); + connect(_form, SIGNAL(destroyed()), SLOT(handleFormDestroyed())); } MetaWatchDigitalSimulator::~MetaWatchDigitalSimulator() { + _connected = false; delete _form; } @@ -101,7 +103,7 @@ void MetaWatchDigitalSimulator::vibrate(bool on) void MetaWatchDigitalSimulator::retryConnect() { if (!_connected && _form) { - qDebug() << "connected"; + qDebug() << "simulator connected"; _connected = true; _currentMode = IdleMode; @@ -118,3 +120,13 @@ void MetaWatchDigitalSimulator::send(const Message &msg) // Do not send messages Q_UNUSED(msg); } + +void MetaWatchDigitalSimulator::handleFormDestroyed() +{ + if (_connected) { + _connected = false; + qDebug() << "simulator disconnected"; + emit disconnected(); + _form = 0; + } +} |