From ae1f2a6cd4e877e50d185db857c9aaa70aee8b86 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 6 Jan 2022 09:54:37 +0100 Subject: qml{plugindump|importscanner}: Don't mix std::cerr and std::wcerr Apparently that causes output to be suppressed. Fixes: QTBUG-99400 Change-Id: I4ac6a66a10c7d2c27dfc1efa6d52afa60bdc58d6 Reviewed-by: Friedemann Kleint Reviewed-by: Fawzi Mohamed Reviewed-by: Volker Hilsheimer (cherry picked from commit 5fa9093191c8a0fbf765f3b51a68dea996fed76e) Reviewed-by: Qt Cherry-pick Bot --- tools/qmlimportscanner/main.cpp | 6 +++--- tools/qmlplugindump/main.cpp | 12 +----------- 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'tools') diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp index 15ff387486..605ea03400 100644 --- a/tools/qmlimportscanner/main.cpp +++ b/tools/qmlimportscanner/main.cpp @@ -79,14 +79,14 @@ inline QString preferLiteral() { return QStringLiteral("prefer"); } void printUsage(const QString &appNameIn) { - const std::wstring appName = appNameIn.toStdWString(); + const std::string appName = appNameIn.toStdString(); const QString qmlPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath); - std::wcerr + std::cerr << "Usage: " << appName << " -rootPath path/to/app/qml/directory -importPath path/to/qt/qml/directory\n" " " << appName << " -qmlFiles file1 file2 -importPath path/to/qt/qml/directory\n" " " << appName << " -qrcFiles file1.qrc file2.qrc -importPath path/to/qt/qml/directory\n\n" "Example: " << appName << " -rootPath . -importPath " - << QDir::toNativeSeparators(qmlPath).toStdWString() + << QDir::toNativeSeparators(qmlPath).toStdString() << '\n'; } diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index d594736c76..de1e03695e 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -991,19 +991,9 @@ void compactDependencies(QStringList *dependencies) } } -inline std::wostream &operator<<(std::wostream &str, const QString &s) -{ -#ifdef Q_OS_WIN - str << reinterpret_cast(s.utf16()); -#else - str << s.toStdWString(); -#endif - return str; -} - void printDebugMessage(QtMsgType, const QMessageLogContext &, const QString &msg) { - std::wcerr << msg << std::endl; + std::cerr << msg.toStdString() << std::endl; // In case of QtFatalMsg the calling code will abort() when appropriate. } -- cgit v1.2.3