diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-02-24 09:14:20 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-26 22:01:27 +0100 |
commit | 1b76cf017427a98bf4487f3cf576611d82097539 (patch) | |
tree | f7348ce5e47854ea1e608a873b19b4c6889e5a41 /src/plugins/platforms/eglfs/qeglfsscreen.cpp | |
parent | bc5170f274572a4b262569c12d5d3c6ef892aaf2 (diff) |
EGLFS: Replace the global static 'hooks' variable with a function
Having a global static variable in a header is a poor choice to start
with. All .cpp including that header must use that variable or the
compiler will warn of an unused static.
Second, for the case of platform hooks, it's possible that it is reading
the value of a variable that isn't initialised yet.
Change-Id: Id823c2be9cfededb9c31fb76a9080d4122577ca4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsscreen.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 43d7cb3b1f..83f50dd382 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -56,7 +56,7 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy) static int hideCursor = qgetenv("QT_QPA_EGLFS_HIDECURSOR").toInt(); if (!hideCursor) { - if (QEglFSCursor *customCursor = hooks->createCursor(this)) + if (QEglFSCursor *customCursor = QEglFSHooks::hooks()->createCursor(this)) m_cursor = customCursor; else m_cursor = new QEglFSCursor(this); @@ -70,22 +70,22 @@ QEglFSScreen::~QEglFSScreen() QRect QEglFSScreen::geometry() const { - return QRect(QPoint(0, 0), hooks->screenSize()); + return QRect(QPoint(0, 0), QEglFSHooks::hooks()->screenSize()); } int QEglFSScreen::depth() const { - return hooks->screenDepth(); + return QEglFSHooks::hooks()->screenDepth(); } QImage::Format QEglFSScreen::format() const { - return hooks->screenFormat(); + return QEglFSHooks::hooks()->screenFormat(); } QSizeF QEglFSScreen::physicalSize() const { - return hooks->physicalScreenSize(); + return QEglFSHooks::hooks()->physicalScreenSize(); } QPlatformCursor *QEglFSScreen::cursor() const |