diff options
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r-- | tools/qml/main.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index a75023b..dfd1726 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -49,12 +49,17 @@ #include <QTranslator> #include <QDebug> #include <QMessageBox> +#include <QAtomicInt> #include "qdeclarativetester.h" QT_USE_NAMESPACE QtMsgHandler systemMsgOutput = 0; +#if defined(Q_WS_S60) +#include <aknappui.h> // For locking app to portrait +#endif + #if defined (Q_OS_SYMBIAN) #include <unistd.h> #include <sys/types.h> @@ -89,19 +94,25 @@ void showWarnings() } } +static QAtomicInt recursiveLock(0); + void myMessageOutput(QtMsgType type, const char *msg) { - if (!logger.isNull()) { - QString strMsg = QString::fromAscii(msg); - QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg)); + QString strMsg = QString::fromLatin1(msg); + + if (!logger.isNull() && !QCoreApplication::closingDown()) { + if (recursiveLock.testAndSetOrdered(0, 1)) { + QMetaObject::invokeMethod(logger.data(), "append", Q_ARG(QString, strMsg)); + recursiveLock = 0; + } } else { - warnings += msg; + warnings += strMsg; warnings += QLatin1Char('\n'); } if (systemMsgOutput) { // Windows systemMsgOutput(type, msg); } else { // Unix - fprintf(stderr, "%s\n",msg); + fprintf(stderr, "%s\n", msg); fflush(stderr); } } @@ -119,7 +130,7 @@ void usage() qWarning(" -fullscreen............................... run fullscreen"); qWarning(" -stayontop................................ keep viewer window on top"); qWarning(" -sizeviewtorootobject .................... the view resizes to the changes in the content"); - qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view"); + qWarning(" -sizerootobjecttoview .................... the content resizes to the changes in the view (default)"); qWarning(" -qmlbrowser .............................. use a QML-based file browser"); qWarning(" -warnings [show|hide]..................... show warnings in a separate log window"); qWarning(" -recordfile <output> ..................... set video recording file"); @@ -200,6 +211,13 @@ int main(int argc, char ** argv) app.setOrganizationName("Nokia"); app.setOrganizationDomain("nokia.com"); +#if defined(Q_WS_S60) + CAknAppUi *appUi = static_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi()); + if (appUi) { + appUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); + } +#endif + QDeclarativeViewer::registerTypes(); QDeclarativeTester::registerTypes(); |