Fix crash if IBus is not configured.

Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-06-29 12:01:41 +02:00
parent 3ffe4283b6
commit ce01064f83

View File

@ -78,8 +78,10 @@ public:
QIBusPlatformInputContext::QIBusPlatformInputContext ()
: d(new QIBusPlatformInputContextPrivate())
{
if (d->context) {
connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
}
}
QIBusPlatformInputContext::~QIBusPlatformInputContext (void)
@ -213,7 +215,7 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
context(0),
valid(false)
{
if (!connection->isConnected()) {
if (!connection || !connection->isConnected()) {
qDebug() << "not connected";
return;
}