diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-08-10 14:14:22 +0200 |
---|---|---|
committer | Matthew Cattell <matthew.cattell@nokia.com> | 2011-08-16 15:38:48 +0200 |
commit | 06f6b71ba43e8302d61d2c3cb7118d9dbf7a3c98 (patch) | |
tree | e907e3c7d90ccee7fb369f2de5f11dbabfb225e3 /src/plugins/platforms/xcb | |
parent | 1ff94e314835682b178eac98c3c1be983e71c4ca (diff) |
Don't set platform input context if it's not properly created.
Prevent xcb applications from failing to launch when IBus is not
initialized correctly.
Change-Id: I8425403e02d0eb5401f8d8bb0d012b53ab9400d9
Reviewed-on: http://codereview.qt.nokia.com/3044
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 3053cba81e..e97b9f2121 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -99,10 +99,14 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters) m_fontDatabase = new QGenericUnixFontDatabase(); m_nativeInterface = new QXcbNativeInterface; -#if defined(XCB_USE_IBUS) - m_inputContext = new QIBusPlatformInputContext; -#else m_inputContext = 0; +#if defined(XCB_USE_IBUS) + QIBusPlatformInputContext *context = new QIBusPlatformInputContext; + if (context->isValid()) { + m_inputContext = context; + } else { + delete context; + } #endif } diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index adaed53106..6f37c078a1 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -49,7 +49,6 @@ #include <private/qguiapplication_p.h> #include <stdio.h> -#define XCB_USE_IBUS #if defined(XCB_USE_IBUS) #include "QtPlatformSupport/qibusplatforminputcontext.h" #endif |