summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/linuxaccessibility
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-10-17 17:48:34 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-03-12 17:29:36 +0000
commit6417bbde8565e0be2d049426b71e6fda538e4440 (patch)
tree8e60f1edf1f8e0f07fc1e6eed23e44389bdb9a67 /src/platformsupport/linuxaccessibility
parent8c0ae00dd603bfe5aa99b5b2db8c1ffdaa6cd45e (diff)
QtBase (remainder): use printf-style qWarning/qDebug where possible (I)
The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/linuxaccessibility')
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index d982c5afff..2b81de43a7 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -783,7 +783,7 @@ void AtSpiAdaptor::updateEventListeners()
}
m_applicationAdaptor->sendEvents(!evList.isEmpty());
} else {
- qAtspiDebug() << "Could not query active accessibility event listeners.";
+ qAtspiDebug("Could not query active accessibility event listeners.");
}
}
@@ -944,7 +944,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_text_changed) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface || !iface->textInterface()) {
- qAtspiDebug() << "Received text event for invalid interface.";
+ qAtspiDebug("Received text event for invalid interface.");
return;
}
QString path = pathForInterface(iface);
@@ -1030,7 +1030,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning() << "ValueChanged event from invalid accessible.";
+ qWarning("ValueChanged event from invalid accessible.");
return;
}
if (iface->valueInterface()) {
@@ -1059,7 +1059,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::Selection: {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning() << "Selection event from invalid accessible.";
+ qWarning("Selection event from invalid accessible.");
return;
}
QString path = pathForInterface(iface);
@@ -1076,7 +1076,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
if (stateChange.checked) {
QAccessibleInterface * iface = event->accessibleInterface();
if (!iface) {
- qWarning() << "StateChanged event from invalid accessible.";
+ qWarning("StateChanged event from invalid accessible.");
return;
}
int checked = iface->state().checked;
@@ -1481,7 +1481,7 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
}
#ifdef ACCESSIBLE_CREATION_DEBUG
else {
- qAtspiDebug() << " IS NOT a component";
+ qAtspiDebug(" IS NOT a component");
}
#endif
if (interface->role() == QAccessible::Application)
@@ -1538,7 +1538,7 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
Q_ASSERT(object);
if (inheritsQAction(object)) {
- qAtspiDebug() << "AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.";
+ qAtspiDebug("AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.");
}
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object);
@@ -1669,18 +1669,18 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt
// int width = message.arguments().at(2).toInt();
// int height = message.arguments().at(3).toInt();
// uint coordinateType = message.arguments().at(4).toUInt();
- qAtspiDebug() << "SetExtents is not implemented.";
+ qAtspiDebug("SetExtents is not implemented.");
sendReply(connection, message, false);
} else if (function == QLatin1String("SetPosition")) {
// int x = message.arguments().at(0).toInt();
// int y = message.arguments().at(1).toInt();
// uint coordinateType = message.arguments().at(2).toUInt();
- qAtspiDebug() << "SetPosition is not implemented.";
+ qAtspiDebug("SetPosition is not implemented.");
sendReply(connection, message, false);
} else if (function == QLatin1String("SetSize")) {
// int width = message.arguments().at(0).toInt();
// int height = message.arguments().at(1).toInt();
- qAtspiDebug() << "SetSize is not implemented.";
+ qAtspiDebug("SetSize is not implemented.");
sendReply(connection, message, false);
} else {
qAtspiDebug() << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path();