eglfs: Update screen destruction to follow the new approach

Call destroyScreen(), like other platform plugins do since
9b4fbe85d2e00c625c3d4abd975faf555000f685.

Change-Id: Idbddb026d7a964f15c00acfacf70064405dc3f16
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
This commit is contained in:
Laszlo Agocs 2015-01-09 12:59:04 +01:00
parent 8836a4d5f0
commit f496c7186c
3 changed files with 13 additions and 2 deletions

View File

@ -40,9 +40,11 @@
****************************************************************************/
#include "qeglfsdeviceintegration.h"
#include "qeglfsintegration.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglplatformcursor_p.h>
#include <QGuiApplication>
#include <private/qguiapplication_p.h>
#include <QScreen>
#include <QDir>
#include <QRegularExpression>
@ -185,8 +187,11 @@ void QEGLDeviceIntegration::screenInit()
void QEGLDeviceIntegration::screenDestroy()
{
while (!qApp->screens().isEmpty())
delete qApp->screens().last()->handle();
QGuiApplication *app = qGuiApp;
QEglFSIntegration *platformIntegration = static_cast<QEglFSIntegration *>(
QGuiApplicationPrivate::platformIntegration());
while (!app->screens().isEmpty())
platformIntegration->removeScreen(app->screens().last()->handle());
}
QSizeF QEGLDeviceIntegration::physicalScreenSize() const

View File

@ -82,6 +82,11 @@ void QEglFSIntegration::addScreen(QPlatformScreen *screen)
screenAdded(screen);
}
void QEglFSIntegration::removeScreen(QPlatformScreen *screen)
{
destroyScreen(screen);
}
void QEglFSIntegration::initialize()
{
qt_egl_device_integration()->platformInit();

View File

@ -47,6 +47,7 @@ public:
QEglFSIntegration();
void addScreen(QPlatformScreen *screen);
void removeScreen(QPlatformScreen *screen);
void initialize() Q_DECL_OVERRIDE;
void destroy() Q_DECL_OVERRIDE;