summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@nokia.com>2009-10-08 15:21:37 +0200
committercon <qtc-committer@nokia.com>2009-10-08 18:55:18 +0200
commita5ff5998f5b3bfe799c6123ec3287425e94b6205 (patch)
treee4bc8d2188c703d8249cbe302a7aa359261e6aa1
parent6f85b24ab73e41b1fd5687943d01e1f8d75624ed (diff)
downloadqt-creator-a5ff5998f5b3bfe799c6123ec3287425e94b6205.tar.gz
Trk: Closing TrkDevice when Launcher emits finished()
Reviewed-by: Friedemann Kleint (cherry picked from commit 6bcfee48403053c12dab7f97148f208dc1c7e6a6)
-rw-r--r--src/shared/trk/launcher.cpp1
-rw-r--r--src/shared/trk/trkdevice.cpp2
-rw-r--r--src/shared/trk/trkdevice.h4
3 files changed, 5 insertions, 2 deletions
diff --git a/src/shared/trk/launcher.cpp b/src/shared/trk/launcher.cpp
index bae9c37e9b..3d808b2224 100644
--- a/src/shared/trk/launcher.cpp
+++ b/src/shared/trk/launcher.cpp
@@ -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()
diff --git a/src/shared/trk/trkdevice.cpp b/src/shared/trk/trkdevice.cpp
index c7ebe792b7..7aee9bf00e 100644
--- a/src/shared/trk/trkdevice.cpp
+++ b/src/shared/trk/trkdevice.cpp
@@ -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));
diff --git a/src/shared/trk/trkdevice.h b/src/shared/trk/trkdevice.h
index 579d32acf3..632dea1b24 100644
--- a/src/shared/trk/trkdevice.h
+++ b/src/shared/trk/trkdevice.h
@@ -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;