From 27d7d7c69ee185a4b99913a518879d39058d935b Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 23 Jun 2012 22:50:14 +0200 Subject: [PATCH] Fix warning when ibus is not available. This is perfectly ok on a linux desktop, so no reason to abort when setting QT_FATAL_WARNINGS. Change-Id: I64ba987679195741631fb204af57ae3d283bb516 Reviewed-by: Friedemann Kleint --- .../ibus/qibusplatforminputcontext.cpp | 10 ++-------- .../maliit/qmaliitplatforminputcontext.cpp | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp index 38fe0cce51..2ee8c89fc8 100644 --- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp +++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp @@ -272,10 +272,8 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate() context(0), valid(false) { - if (!connection || !connection->isConnected()) { - qDebug("QIBusPlatformInputContext: not connected."); + if (!connection || !connection->isConnected()) return; - } bus = new QIBusProxy(QLatin1String("org.freedesktop.IBus"), QLatin1String("/org/freedesktop/IBus"), @@ -333,12 +331,8 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection() QLatin1String(QDBusConnection::localMachineId()) + QLatin1Char('-') + QString::fromLocal8Bit(host) + QLatin1Char('-') + QString::fromLocal8Bit(displayNumber)); - if (!file.exists()) { - qWarning("QIBusPlatformInputContext: ibus config file '%s' does not exist.", qPrintable(file.fileName())); + if (!file.open(QFile::ReadOnly)) return 0; - } - - file.open(QFile::ReadOnly); QByteArray address; int pid = -1; diff --git a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp index c325927dac..2991b9ef81 100644 --- a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp +++ b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp @@ -551,10 +551,8 @@ QMaliitPlatformInputContextPrivate::QMaliitPlatformInputContextPrivate(QMaliitPl , correctionEnabled(false) , q(qq) { - if (!connection.isConnected()) { - qDebug("QMaliitPlatformInputContext: not connected."); + if (!connection.isConnected()) return; - } server = new ComMeegoInputmethodUiserver1Interface(QStringLiteral(""), QStringLiteral("/com/meego/inputmethod/uiserver1"), connection); adaptor = new Inputcontext1Adaptor(qq);