summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/kms/qkmsintegration.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-11 11:46:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 14:59:55 +0100
commit17de86f2824c1807c0fa7fa7ae0ed3b7d2acca00 (patch)
treeffd784679d3fb1d5236aa286e7f290c75e2c0458 /src/plugins/platforms/kms/qkmsintegration.cpp
parentb4fe9ce225869917c4e822f936596563d7593480 (diff)
kms: Adapt to initialize() pattern
Right now socket notifiers are attempted to be created before having the event dispatcher up. This is wrong. Change-Id: Ica3034b9fa790c037f28982db23c71342f6597d7 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/plugins/platforms/kms/qkmsintegration.cpp')
-rw-r--r--src/plugins/platforms/kms/qkmsintegration.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/plugins/platforms/kms/qkmsintegration.cpp b/src/plugins/platforms/kms/qkmsintegration.cpp
index 63c6d08bdc..868886a0dd 100644
--- a/src/plugins/platforms/kms/qkmsintegration.cpp
+++ b/src/plugins/platforms/kms/qkmsintegration.cpp
@@ -66,9 +66,28 @@ QT_BEGIN_NAMESPACE
QKmsIntegration::QKmsIntegration()
: QPlatformIntegration(),
m_fontDatabase(new QGenericUnixFontDatabase()),
- m_nativeInterface(new QKmsNativeInterface)
+ m_nativeInterface(new QKmsNativeInterface),
+ m_vtHandler(0),
+ m_deviceDiscovery(0)
{
- setenv("EGL_PLATFORM", "drm",1);
+}
+
+QKmsIntegration::~QKmsIntegration()
+{
+ delete m_deviceDiscovery;
+ foreach (QKmsDevice *device, m_devices) {
+ delete device;
+ }
+ foreach (QPlatformScreen *screen, m_screens) {
+ delete screen;
+ }
+ delete m_fontDatabase;
+ delete m_vtHandler;
+}
+
+void QKmsIntegration::initialize()
+{
+ qputenv("EGL_PLATFORM", "drm");
m_vtHandler = new QFbVtHandler;
m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_DRM | QDeviceDiscovery::Device_DRM_PrimaryGPU, 0);
@@ -88,19 +107,6 @@ QKmsIntegration::QKmsIntegration()
#endif
}
-QKmsIntegration::~QKmsIntegration()
-{
- delete m_deviceDiscovery;
- foreach (QKmsDevice *device, m_devices) {
- delete device;
- }
- foreach (QPlatformScreen *screen, m_screens) {
- delete screen;
- }
- delete m_fontDatabase;
- delete m_vtHandler;
-}
-
void QKmsIntegration::addDevice(const QString &deviceNode)
{
m_devices.append(new QKmsDevice(deviceNode, this));