From 452a27e1f0abba550cba24390c03a05d9091bedc Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 2 Sep 2015 11:07:33 +0200 Subject: Winrt: Show message when command line processing fails/usage should be shown Change-Id: If8f69906beb22f632ccbde92aab5caf914dcb31b Reviewed-by: Friedemann Kleint --- src/corelib/tools/qcommandlineparser.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qcommandlineparser.cpp') diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index 15c7a0646fb..2bc60c5b9ee 100644 --- a/src/corelib/tools/qcommandlineparser.cpp +++ b/src/corelib/tools/qcommandlineparser.cpp @@ -540,7 +540,13 @@ static inline bool displayMessageBox() static void showParserMessage(const QString &message, MessageType type) { -#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) + if (type == UsageMessage) + qInfo(qPrintable(message)); + else + qCritical(qPrintable(message)); + return; +#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE) if (displayMessageBox()) { const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND | (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR); @@ -553,7 +559,7 @@ static void showParserMessage(const QString &message, MessageType type) reinterpret_cast(title.utf16()), flags); return; } -#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WIN && !Q_OS_WINRT +#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WINCE fputs(qPrintable(message), type == UsageMessage ? stdout : stderr); } -- cgit v1.2.3