forked from qt-creator/qt-creator
Trk: Closing TrkDevice when Launcher emits finished()
Reviewed-by: Friedemann Kleint
This commit is contained in:
@@ -76,6 +76,7 @@ Launcher::Launcher(Actions startupActions) :
|
|||||||
{
|
{
|
||||||
d->m_startupActions = startupActions;
|
d->m_startupActions = startupActions;
|
||||||
connect(&d->m_device, SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
|
connect(&d->m_device, SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
|
||||||
|
connect(this, SIGNAL(finished()), &d->m_device, SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Launcher::~Launcher()
|
Launcher::~Launcher()
|
||||||
|
@@ -893,7 +893,7 @@ bool TrkDevice::open(const QString &port, QString *errorMessage)
|
|||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(d->readerThread.data(), SIGNAL(messageReceived(trk::TrkResult,QByteArray)),
|
connect(d->readerThread.data(), SIGNAL(messageReceived(trk::TrkResult,QByteArray)),
|
||||||
this, SLOT(slotMessageReceived(trk::TrkResult,QByteArray)),
|
this, SLOT(slotMessageReceived(trk::TrkResult,QByteArray)),
|
||||||
Qt::BlockingQueuedConnection);
|
Qt::QueuedConnection);
|
||||||
d->readerThread->start();
|
d->readerThread->start();
|
||||||
|
|
||||||
d->writerThread = QSharedPointer<WriterThread>(new WriterThread(d->deviceContext));
|
d->writerThread = QSharedPointer<WriterThread>(new WriterThread(d->deviceContext));
|
||||||
|
@@ -73,7 +73,6 @@ public:
|
|||||||
|
|
||||||
bool open(const QString &port, QString *errorMessage);
|
bool open(const QString &port, QString *errorMessage);
|
||||||
bool isOpen() const;
|
bool isOpen() const;
|
||||||
void close();
|
|
||||||
|
|
||||||
QString errorString() const;
|
QString errorString() const;
|
||||||
|
|
||||||
@@ -109,6 +108,9 @@ protected slots:
|
|||||||
void emitError(const QString &msg);
|
void emitError(const QString &msg);
|
||||||
void emitLogMessage(const QString &msg);
|
void emitLogMessage(const QString &msg);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void close();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void readMessages();
|
void readMessages();
|
||||||
TrkDevicePrivate *d;
|
TrkDevicePrivate *d;
|
||||||
|
Reference in New Issue
Block a user