summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-10 17:17:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-22 12:12:17 +0100
commitdb51ffc0d1fbce85fd542403812fab8783c53e3c (patch)
tree2e7a051dbf6701b477e4c19de014a44dbaf84c37 /src/plugins/platforms/windows/qwindowsfontengine.cpp
parenta5c288ea5675a382edf0b3ecae42f461a22a7303 (diff)
Port Windows QPA plugin to new logger API.
Introduce logging categories and change most debug statements to qCDebug(). Retrieve the filter rules from the environment variable QT_QPA_VERBOSE (should be removed once the logging framework offers a more convenient way of configuring). Replace the old per-category variables controlling verboseness of the output by a single variable which can be set on the command line. Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsfontengine.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 6c928119b3..6ff000e7d4 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -325,8 +325,7 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
designAdvances(0),
designAdvancesSize(0)
{
- if (QWindowsContext::verboseFonts)
- qDebug("%s: font='%s', size=%ld", __FUNCTION__, qPrintable(name), lf.lfHeight);
+ qCDebug(lcQpaFonts) << __FUNCTION__ << name << lf.lfHeight;
HDC hdc = m_fontEngineData->hdc;
SelectObject(hdc, hfont);
fontDef.pixelSize = -lf.lfHeight;
@@ -366,9 +365,7 @@ QWindowsFontEngine::~QWindowsFontEngine()
if (!DeleteObject(hfont))
qErrnoWarning("%s: QFontEngineWin: failed to delete non-stock font... failed", __FUNCTION__);
}
- if (QWindowsContext::verboseFonts)
- if (QWindowsContext::verboseFonts)
- qDebug("%s: font='%s", __FUNCTION__, qPrintable(_name));
+ qCDebug(lcQpaFonts) << __FUNCTION__ << _name;
if (!uniqueFamilyName.isEmpty()) {
QPlatformFontDatabase *pfdb = QWindowsIntegration::instance()->fontDatabase();
@@ -1347,8 +1344,7 @@ QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *first, const QStri
: QFontEngineMulti(fallbacks.size()+1),
fallbacks(fallbacks)
{
- if (QWindowsContext::verboseFonts)
- qDebug() << __FUNCTION__ << engines.size() << first << first->fontDef.family << fallbacks;
+ qCDebug(lcQpaFonts) << __FUNCTION__ << engines.size() << first << first->fontDef.family << fallbacks;
engines[0] = first;
first->ref.ref();
fontDef = engines[0]->fontDef;
@@ -1357,8 +1353,7 @@ QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *first, const QStri
QWindowsMultiFontEngine::~QWindowsMultiFontEngine()
{
- if (QWindowsContext::verboseFonts)
- qDebug("%s", __FUNCTION__);
+ qCDebug(lcQpaFonts) << __FUNCTION__;
}
void QWindowsMultiFontEngine::loadEngine(int at)
@@ -1409,9 +1404,7 @@ void QWindowsMultiFontEngine::loadEngine(int at)
fedw->ref.ref();
engines[at] = fedw;
- if (QWindowsContext::verboseFonts)
- qDebug("%s %d %s", __FUNCTION__, at, qPrintable(fam));
-
+ qCDebug(lcQpaFonts) << __FUNCTION__ << at << fam;
return;
} else {
qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__);
@@ -1433,9 +1426,7 @@ void QWindowsMultiFontEngine::loadEngine(int at)
engines[at] = new QWindowsFontEngine(fam, hfont, stockFont, lf, data);
engines[at]->ref.ref();
engines[at]->fontDef = fontDef;
- if (QWindowsContext::verboseFonts)
- qDebug("%s %d %s", __FUNCTION__, at, qPrintable(fam));
-
+ qCDebug(lcQpaFonts) << __FUNCTION__ << at << fam;
// TODO: increase cost in QFontCache for the font engine loaded here
}