Trk: Closing TrkDevice when Launcher emits finished()

Reviewed-by: Friedemann Kleint
This commit is contained in:
Robert Loehning
2009-10-08 15:21:37 +02:00
parent ac4f53ef40
commit 6bcfee4840
3 changed files with 5 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ Launcher::Launcher(Actions startupActions) :
{
d->m_startupActions = startupActions;
connect(&d->m_device, SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
connect(this, SIGNAL(finished()), &d->m_device, SLOT(close()));
}
Launcher::~Launcher()

View File

@@ -893,7 +893,7 @@ bool TrkDevice::open(const QString &port, QString *errorMessage)
Qt::QueuedConnection);
connect(d->readerThread.data(), SIGNAL(messageReceived(trk::TrkResult,QByteArray)),
this, SLOT(slotMessageReceived(trk::TrkResult,QByteArray)),
Qt::BlockingQueuedConnection);
Qt::QueuedConnection);
d->readerThread->start();
d->writerThread = QSharedPointer<WriterThread>(new WriterThread(d->deviceContext));

View File

@@ -73,7 +73,6 @@ public:
bool open(const QString &port, QString *errorMessage);
bool isOpen() const;
void close();
QString errorString() const;
@@ -109,6 +108,9 @@ protected slots:
void emitError(const QString &msg);
void emitLogMessage(const QString &msg);
public slots:
void close();
private:
void readMessages();
TrkDevicePrivate *d;