From e79202be457298c48b13eef4f8c35df186216aea Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 21 Apr 2010 11:19:00 +1000 Subject: Use different ports to avoid clashes in parallel testing. --- .../qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp | 4 ++-- .../qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index fb17f90..102b2be 100644 --- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -74,11 +74,11 @@ private slots: void tst_QDeclarativeDebugClient::initTestCase() { - qputenv("QML_DEBUG_SERVER_PORT", "3768"); + qputenv("QML_DEBUG_SERVER_PORT", "3770"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); - m_conn->connectToHost("127.0.0.1", 3768); + m_conn->connectToHost("127.0.0.1", 3770); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 80d7f76..5da3359 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -76,11 +76,11 @@ private slots: void tst_QDeclarativeDebugService::initTestCase() { - qputenv("QML_DEBUG_SERVER_PORT", "3768"); + qputenv("QML_DEBUG_SERVER_PORT", "3769"); new QDeclarativeEngine(this); m_conn = new QDeclarativeDebugConnection(this); - m_conn->connectToHost("127.0.0.1", 3768); + m_conn->connectToHost("127.0.0.1", 3769); bool ok = m_conn->waitForConnected(); Q_ASSERT(ok); @@ -151,7 +151,7 @@ void tst_QDeclarativeDebugService::idForObject() int idB = QDeclarativeDebugService::idForObject(objB); QVERIFY(idB != idA); QCOMPARE(QDeclarativeDebugService::objectForId(idB), objB); - + delete objA; delete objB; } -- cgit v0.12 From f92518f6de1a13b591fb2c2037714b213bdcff89 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 21 Apr 2010 12:02:20 +1000 Subject: Make logger widget thread safe. --- tools/qml/loggerwidget.cpp | 4 ++-- tools/qml/loggerwidget.h | 3 ++- tools/qml/main.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp index c5548b7..015d1b0 100644 --- a/tools/qml/loggerwidget.cpp +++ b/tools/qml/loggerwidget.cpp @@ -53,9 +53,9 @@ LoggerWidget::LoggerWidget(QWidget *parent) : setWindowTitle(tr("Qt Declarative UI Viewer - Logger")); } -void LoggerWidget::append(QtMsgType /*type*/, const char *msg) +void LoggerWidget::append(const QString &msg) { - appendPlainText(QString::fromAscii(msg)); + appendPlainText(msg); if (!m_keepClosed && !isVisible()) setVisible(true); diff --git a/tools/qml/loggerwidget.h b/tools/qml/loggerwidget.h index 938431c..5c4a701 100644 --- a/tools/qml/loggerwidget.h +++ b/tools/qml/loggerwidget.h @@ -50,7 +50,8 @@ class LoggerWidget : public QPlainTextEdit { Q_OBJECT public: LoggerWidget(QWidget *parent=0); - void append(QtMsgType type, const char *msg); +public slots: + void append(const QString &msg); protected: void closeEvent(QCloseEvent *event); private: diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index a79e1b1..e90d729 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -93,7 +93,8 @@ void showWarnings() void myMessageOutput(QtMsgType type, const char *msg) { if (!logger.isNull()) { - logger.data()->append(type, msg); + QString strMsg = QString::fromAscii(msg); + QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg)); } else { warnings += msg; warnings += QLatin1Char('\n'); -- cgit v0.12