Fix some compiler warnings, shut up QIbusPlatformInputContext.

Change-Id: Idadf40b2bbe53928d8577a099f38a2be0a2d6e16
Reviewed-on: http://codereview.qt.nokia.com/3640
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2011-08-26 10:02:43 +02:00
parent 5a23825f01
commit d1b3cc0d0c
5 changed files with 33 additions and 18 deletions

View File

@ -104,6 +104,7 @@ bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const
bool QPlatformClipboard::ownsMode(QClipboard::Mode mode) const
{
Q_UNUSED(mode);
return false;
}

View File

@ -7420,8 +7420,9 @@ void QPainter::setRedirected(const QPaintDevice *device,
const QPoint &offset)
{
Q_ASSERT(device != 0);
qWarning() << "QPainter::setRedirected(): ignoring call to deprecated function, use QWidget::render() instead";
Q_UNUSED(replacement)
Q_UNUSED(offset)
qWarning("QPainter::setRedirected(): ignoring call to deprecated function, use QWidget::render() instead");
}
/*!
@ -7443,7 +7444,8 @@ void QPainter::setRedirected(const QPaintDevice *device,
*/
void QPainter::restoreRedirected(const QPaintDevice *device)
{
qWarning() << "QPainter::restoreRedirected(): ignoring call to deprecated function, use QWidget::render() instead";
Q_UNUSED(device)
qWarning("QPainter::restoreRedirected(): ignoring call to deprecated function, use QWidget::render() instead");
}
/*!
@ -7465,6 +7467,8 @@ void QPainter::restoreRedirected(const QPaintDevice *device)
*/
QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
{
Q_UNUSED(device)
Q_UNUSED(offset)
return 0;
}

View File

@ -308,6 +308,7 @@ QStringList QBasicUnixFontDatabase::fallbacksForFamily(const QString family, con
Q_UNUSED(family);
Q_UNUSED(style);
Q_UNUSED(script);
Q_UNUSED(styleHint);
return QStringList();
}

View File

@ -54,6 +54,8 @@
#include <QtDBus>
enum { debug = 0 };
class QIBusPlatformInputContextPrivate
{
public:
@ -127,7 +129,8 @@ void QIBusPlatformInputContext::update()
QGuiApplication::sendEvent(o, &query);
QRect r = query.value().toRect();
if(r.isValid()) {
qDebug() << "mocroFocus" << r;
if (debug)
qDebug() << "microFocus" << r;
d->context->SetCursorLocation(r.x(), r.y(), r.width(), r.height());
}
}
@ -139,7 +142,8 @@ void QIBusPlatformInputContext::setFocusObject(QObject *object)
if (!d->valid)
return;
qDebug() << "setFocusObject" << object;
if (debug)
qDebug() << "setFocusObject" << object;
if (object)
d->context->FocusIn();
else
@ -152,9 +156,11 @@ void QIBusPlatformInputContext::commitText(const QDBusVariant &text)
const QDBusArgument arg = text.variant().value<QDBusArgument>();
QIBusText t;
qDebug() << arg.currentSignature();
if (debug)
qDebug() << arg.currentSignature();
t.fromDBusArgument(arg);
qDebug() << "commit text:" << t.text;
if (debug)
qDebug() << "commit text:" << t.text;
QInputMethodEvent event;
event.setCommitString(t.text);
@ -167,7 +173,8 @@ void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint
QIBusText t;
t.fromDBusArgument(arg);
qDebug() << "preedit text:" << t.text;
if (debug)
qDebug() << "preedit text:" << t.text;
QList<QInputMethodEvent::Attribute> attributes = t.attributes.imAttributes();
attributes += QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursorPos, visible ? 1 : 0, QVariant());
@ -221,7 +228,7 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
valid(false)
{
if (!connection || !connection->isConnected()) {
qDebug() << "not connected";
qDebug("QIBusPlatformInputContext: not connected.");
return;
}
@ -229,20 +236,20 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
QLatin1String("/org/freedesktop/IBus"),
*connection);
if (!bus->isValid()) {
qDebug() << "invalid bus";
qWarning("QIBusPlatformInputContext: invalid bus.");
return;
}
QDBusReply<QDBusObjectPath> ic = bus->CreateInputContext(QLatin1String("QIBusInputContext"));
if (!ic.isValid()) {
qDebug() << "CreateInputContext failed";
qWarning("QIBusPlatformInputContext: CreateInputContext failed.");
return;
}
context = new QIBusInputContextProxy(QLatin1String("org.freedesktop.IBus"), ic.value().path(), *connection);
if (!context->isValid()) {
qDebug() << "invalid input context";
qWarning("QIBusPlatformInputContext: invalid input context.");
return;
}
@ -252,11 +259,12 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
IBUS_CAP_LOOKUP_TABLE = 1 << 2,
IBUS_CAP_FOCUS = 1 << 3,
IBUS_CAP_PROPERTY = 1 << 4,
IBUS_CAP_SURROUNDING_TEXT = 1 << 5,
IBUS_CAP_SURROUNDING_TEXT = 1 << 5
};
context->SetCapabilities(IBUS_CAP_PREEDIT_TEXT|IBUS_CAP_FOCUS);
qDebug() << ">>>> valid!";
if (debug)
qDebug(">>>> valid!");
valid = true;
}
@ -273,14 +281,15 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
int pos2 = display.indexOf('.', pos);
if (pos2 > 0)
displayNumber = display.mid(pos, pos2 - pos);
qDebug() << "host=" << host << "displayNumber" << displayNumber;
if (debug)
qDebug() << "host=" << host << "displayNumber" << displayNumber;
QFile file(QDir::homePath() + QLatin1String("/.config/ibus/bus/") +
QLatin1String(QDBusConnection::localMachineId()) +
QLatin1Char('-') + QString::fromLocal8Bit(host) + QLatin1Char('-') + QString::fromLocal8Bit(displayNumber));
if (!file.exists()) {
qDebug() << "ibus config file does not exist";
qWarning("QIBusPlatformInputContext: ibus config file '%s' does not exist.", qPrintable(file.fileName()));
return 0;
}
@ -300,7 +309,8 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
pid = line.mid(sizeof("IBUS_DAEMON_PID=") - 1).toInt();
}
qDebug() << "IBUS_ADDRESS=" << address << "PID=" << pid;
if (debug)
qDebug() << "IBUS_ADDRESS=" << address << "PID=" << pid;
if (address.isEmpty() || pid < 0 || kill(pid, 0) != 0)
return 0;

View File

@ -122,7 +122,6 @@ QXcbWindow::QXcbWindow(QWindow *window)
void QXcbWindow::create()
{
bool wasCreated = (m_window != 0);
destroy();
m_windowState = Qt::WindowNoState;