diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-02-14 15:39:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-14 15:43:37 +0100 |
commit | 25e7fe16504ad4784ea2d75204ffa855ca6d3e1b (patch) | |
tree | a44162778acc26ded7091ee4bb4787d433d44b33 /src/gui/opengl | |
parent | 71de22b03f5e568f4a47c712c0a215c557d9162f (diff) |
Fix logging with dynamic GL on Windows
category() returns a const QLoggingCategory so our code does not
compile anymore. Do it differently.
Fix also the Windows error string formatting a bit.
Change-Id: Ie0b6b02947d94b7ccf4a4a57da487dfa8a15709d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglproxy_win.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/opengl/qopenglproxy_win.cpp b/src/gui/opengl/qopenglproxy_win.cpp index 04ba794e66..83c3073f63 100644 --- a/src/gui/opengl/qopenglproxy_win.cpp +++ b/src/gui/opengl/qopenglproxy_win.cpp @@ -654,7 +654,7 @@ static QString qgl_windowsErrorMessage(unsigned long errorCode) FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorCode, 0, (LPTSTR)&lpMsgBuf, 0, NULL); if (len) { - rc = QString::fromUtf16(lpMsgBuf, len); + rc += QString::fromUtf16(lpMsgBuf, len); LocalFree(lpMsgBuf); } else { rc += QString::fromLatin1("<unknown error>"); @@ -671,7 +671,7 @@ static HMODULE qgl_loadLib(const char *name, bool warnOnFail = true) if (warnOnFail) { QString msg = qgl_windowsErrorMessage(GetLastError()); - qCWarning(qglLc, "Failed to load %s (%s)", name, qPrintable(msg)); + qCWarning(qglLc, "Failed to load %s: %s", name, qPrintable(msg)); } return 0; @@ -680,9 +680,8 @@ static HMODULE qgl_loadLib(const char *name, bool warnOnFail = true) QWindowsOpenGL::QWindowsOpenGL() : m_eglLib(0) { - qglLc().setEnabled(QtWarningMsg, true); if (qEnvironmentVariableIsSet("QT_OPENGLPROXY_DEBUG")) - qglLc().setEnabled(QtDebugMsg, true); + QLoggingCategory::setFilterRules(QStringLiteral("qt.gui.openglproxy=true")); enum RequestedLib { Unknown, |