summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxscreen.cpp
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-01-17 20:45:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-28 19:32:53 +0100
commitb8103a4e8174446584caf80c0bf1a006b25d9905 (patch)
tree465a99e8d15a6037e48dccbb7a7aba5530b332ea /src/plugins/platforms/qnx/qqnxscreen.cpp
parenta4ff400e25c76a32ec8252285dda043f07b19c15 (diff)
[QNX] Introduce proper screen error handling
This patch adds a new function which does the error handling for libscreen calls. The patch introduces following changes: - Libscreen errors will not crash (qFatal)the application any more but rather post a warning message. -With the "flush-screen-context" option the screen_context is always flushed when a screen function is called. This enables better correlation between the time an error happens and the time it is logged. Change-Id: Ie2456e5b746dcf917d786f3b832847d2ebbe5f1e Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Roger Maclean <rmaclean@qnx.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxscreen.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 8461e37e4d..8d35362b34 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -39,6 +39,8 @@
**
****************************************************************************/
+#include "qqnxglobal.h"
+
#include "qqnxscreen.h"
#include "qqnxwindow.h"
#include "qqnxcursor.h"
@@ -75,10 +77,9 @@ QT_BEGIN_NAMESPACE
static QSize determineScreenSize(screen_display_t display, bool primaryScreen) {
int val[2];
- errno = 0;
const int result = screen_get_display_property_iv(display, SCREEN_PROPERTY_PHYSICAL_SIZE, val);
+ Q_SCREEN_CHECKERROR(result, "Failed to query display physical size");
if (result != 0) {
- qFatal("QQnxScreen: failed to query display physical size, errno=%d", errno);
return QSize(150, 90);
}
@@ -163,19 +164,16 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
{
qScreenDebug() << Q_FUNC_INFO;
// Cache initial orientation of this display
- errno = 0;
- int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION, &m_initialRotation);
- if (result != 0)
- qFatal("QQnxScreen: failed to query display rotation, errno=%d", errno);
+ int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION,
+ &m_initialRotation);
+ Q_SCREEN_CHECKERROR(result, "Failed to query display rotation");
m_currentRotation = m_initialRotation;
// Cache size of this display in pixels
- errno = 0;
int val[2];
- result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_SIZE, val);
- if (result != 0)
- qFatal("QQnxScreen: failed to query display size, errno=%d", errno);
+ Q_SCREEN_CRITICALERROR(screen_get_display_property_iv(m_display, SCREEN_PROPERTY_SIZE, val),
+ "Failed to query display size");
m_currentGeometry = m_initialGeometry = QRect(0, 0, val[0], val[1]);