diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-10-17 17:48:34 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-03-12 17:29:36 +0000 |
commit | 6417bbde8565e0be2d049426b71e6fda538e4440 (patch) | |
tree | 8e60f1edf1f8e0f07fc1e6eed23e44389bdb9a67 /src/plugins/platforms/ios/qiostextresponder.mm | |
parent | 8c0ae00dd603bfe5aa99b5b2db8c1ffdaa6cd45e (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/plugins/platforms/ios/qiostextresponder.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiostextresponder.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index a894963bbe..6a66bf213e 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -261,7 +261,7 @@ // as well, as the IM state that we were based on may have been invalidated when // IM was switched off. - qImDebug() << "IM was turned on, we need to check hints and platform data as well"; + qImDebug("IM was turned on, we need to check hints and platform data as well"); updatedProperties |= (Qt::ImHints | Qt::ImPlatformData); } @@ -311,7 +311,7 @@ // Don't allow activation events of the window that we're doing text on behalf on // to steal responder. if (FirstResponderCandidate::currentCandidate() == [self nextResponder]) { - qImDebug() << "not allowing parent window to steal responder"; + qImDebug("not allowing parent window to steal responder"); return NO; } @@ -334,7 +334,7 @@ if ([self currentImeState:Qt::ImEnabled].toBool()) { // The current focus object expects text input, but there // is no keyboard to get input from. So we clear focus. - qImDebug() << "no keyboard available, clearing focus object"; + qImDebug("no keyboard available, clearing focus object"); m_inputContext->clearCurrentFocusObject(); } } else { @@ -342,7 +342,7 @@ // another QIOSTextResponder was made first-responder, another UIView was // made first-responder, or the first-responder was cleared globally. In // either of these cases we don't have to do anything. - qImDebug() << "lost first responder, but not clearing focus object"; + qImDebug("lost first responder, but not clearing focus object"); } return YES; |