From 0c7a89f55e216d1f679fedf17f6d014ca722f735 Mon Sep 17 00:00:00 2001 From: Vladimir Belyavsky Date: Thu, 19 Sep 2024 10:21:54 +0300 Subject: [PATCH] QFontDatabase: use categorized logging more Use "qt.text.font.db" logging category to print OpenType related warnings during loading a font engine. Also, as a drive-by change, use qUtf16Printable() to avoid unneeded allocations. Task-number: QTBUG-129092 Pick-to: 6.8 Change-Id: If603aa1251c0073aec7bb0ba75d3e5e9e0385ac1 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 3d6d3b78864..5706def9a1e 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -733,8 +733,8 @@ QFontEngine *QFontDatabasePrivate::loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (Q_UNLIKELY(!engine->supportsScript(QChar::Script(script)))) { - qWarning(" OpenType support missing for \"%s\", script %d", - qPrintable(def.families.constFirst()), script); + qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d", + qUtf16Printable(def.families.constFirst()), script); return nullptr; } @@ -758,8 +758,8 @@ QFontEngine *QFontDatabasePrivate::loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (!engine->supportsScript(QChar::Script(script))) { - qWarning(" OpenType support missing for \"%s\", script %d", - +qPrintable(def.families.constFirst()), script); + qCWarning(lcFontDb, "OpenType support missing for \"%ls\", script %d", + qUtf16Printable(def.families.constFirst()), script); if (engine->ref.loadRelaxed() == 0) delete engine; return nullptr;