diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 18:48:16 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 18:55:12 (GMT) |
commit | 6bffb9055a6548730ba915630007ba44b292b03f (patch) | |
tree | c07d32efbba69e35318e4c9ea078afd5fe1f9987 /tools/qtestlib/wince/cetest/remoteconnection.cpp | |
parent | 435fae071798817f57bc89bf5d1ac20aae488625 (diff) | |
parent | 4d31527417419d4f7c1417b9360ef91d72469aa0 (diff) | |
download | Qt-6bffb9055a6548730ba915630007ba44b292b03f.zip Qt-6bffb9055a6548730ba915630007ba44b292b03f.tar.gz Qt-6bffb9055a6548730ba915630007ba44b292b03f.tar.bz2 |
Merge commit 'qt/master' into graphicssceneindex
Conflicts:
src/gui/graphicsview/qgraphicsitem_p.h
tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
tests/auto/qgraphicsview/tst_qgraphicsview.cpp
Diffstat (limited to 'tools/qtestlib/wince/cetest/remoteconnection.cpp')
-rw-r--r-- | tools/qtestlib/wince/cetest/remoteconnection.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/qtestlib/wince/cetest/remoteconnection.cpp b/tools/qtestlib/wince/cetest/remoteconnection.cpp index 547b211..3d0c3f3 100644 --- a/tools/qtestlib/wince/cetest/remoteconnection.cpp +++ b/tools/qtestlib/wince/cetest/remoteconnection.cpp @@ -41,6 +41,38 @@ #include "remoteconnection.h" +QByteArray strwinerror(DWORD errorcode) +{ + QByteArray out(512, 0); + + DWORD ok = FormatMessageA( + FORMAT_MESSAGE_FROM_SYSTEM, + 0, + errorcode, + 0, + out.data(), + out.size(), + 0 + ); + + if (!ok) { + qsnprintf(out.data(), out.size(), + "(error %d; additionally, error %d while looking up error string)", + (int)errorcode, (int)GetLastError()); + } + else { + out.resize(qstrlen(out.constData())); + if (out.endsWith("\r\n")) + out.chop(2); + + /* Append error number to error message for good measure */ + out.append(" (0x"); + out.append(QByteArray::number(uint(errorcode), 16).rightJustified(8, '0')); + out.append(")"); + } + return out; +} + AbstractRemoteConnection::AbstractRemoteConnection() { } |