aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-11-12 13:18:02 +0100
committerMitch Curtis <mitch.curtis@qt.io>2018-11-28 09:52:11 +0000
commit993a21ba03534b172d5354405cc9d50a2a822e24 (patch)
tree8608935656f6529ce92a05bf0ad9a8e2100e1023
parente85125b532fe8a2b0c33b6f72ff4f827035fc7b9 (diff)
Restrict more sensitive debugging output5.6
There are more places where sensitive information could accidentally be disclosed. Also, move SENSITIVE_DEBUG to config.pri so that plugins can use it. Change-Id: Ifa4ccbd6bf4bf79412f29984c662c9e58ea01992 Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Yuntaek Rim <yuntaek.rim@myscript.com> (cherry picked from commit 5d2d0564a36f99224dc53ad477416097516c6b77)
-rw-r--r--src/config.pri6
-rw-r--r--src/virtualkeyboard/3rdparty/openwnn/wnnEngine/composingtext.cpp2
-rw-r--r--src/virtualkeyboard/inputcontext.cpp12
-rw-r--r--src/virtualkeyboard/lipiinputmethod.cpp2
-rw-r--r--src/virtualkeyboard/t9writeinputmethod.cpp2
-rw-r--r--src/virtualkeyboard/t9writeworker.cpp2
-rw-r--r--src/virtualkeyboard/virtualkeyboarddebug.h4
7 files changed, 23 insertions, 7 deletions
diff --git a/src/config.pri b/src/config.pri
index 6c4bc0d0..024515b6 100644
--- a/src/config.pri
+++ b/src/config.pri
@@ -54,3 +54,9 @@ disable-xcb {
message("The disable-xcb option has been deprecated. Please use disable-desktop instead.")
CONFIG += disable-desktop
}
+
+# Enables logging of sensitive information, such as key events.
+# Should never be enabled by default.
+# It's defined here rather than virtualkeyboarddebug_p.h
+# so that the plugins can use it.
+sensitive-debug: DEFINES += SENSITIVE_DEBUG
diff --git a/src/virtualkeyboard/3rdparty/openwnn/wnnEngine/composingtext.cpp b/src/virtualkeyboard/3rdparty/openwnn/wnnEngine/composingtext.cpp
index e299c6db..082d2fc8 100644
--- a/src/virtualkeyboard/3rdparty/openwnn/wnnEngine/composingtext.cpp
+++ b/src/virtualkeyboard/3rdparty/openwnn/wnnEngine/composingtext.cpp
@@ -206,6 +206,7 @@ StrSegment ComposingText::getStrSegment(TextLayer layer, int pos) const
void ComposingText::debugout() const
{
+#ifdef SENSITIVE_DEBUG
Q_D(const ComposingText);
for (int i = LAYER0; i < MAX_LAYER; i++) {
qDebug() << QString("ComposingText[%1]").arg(i);
@@ -217,6 +218,7 @@ void ComposingText::debugout() const
}
qDebug() << " str =" << tmp;
}
+#endif
}
QString ComposingText::toString(TextLayer layer, int from, int to) const
diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp
index 394631b5..1808b0a2 100644
--- a/src/virtualkeyboard/inputcontext.cpp
+++ b/src/virtualkeyboard/inputcontext.cpp
@@ -475,7 +475,11 @@ void InputContext::commit()
void InputContext::commit(const QString &text, int replaceFrom, int replaceLength)
{
Q_D(InputContext);
- VIRTUALKEYBOARD_DEBUG() << "InputContext::commit():" << text << replaceFrom << replaceLength;
+ VIRTUALKEYBOARD_DEBUG() << "InputContext::commit()"
+#ifdef SENSITIVE_DEBUG
+ << text << replaceFrom << replaceLength
+#endif
+ ;
bool preeditChanged = !d->preeditText.isEmpty();
d->preeditText.clear();
@@ -580,7 +584,11 @@ void InputContext::setFocus(bool enable)
void InputContext::sendPreedit(const QString &text, const QList<QInputMethodEvent::Attribute> &attributes, int replaceFrom, int replaceLength)
{
Q_D(InputContext);
- VIRTUALKEYBOARD_DEBUG() << "InputContext::sendPreedit():" << text << replaceFrom << replaceLength;
+ VIRTUALKEYBOARD_DEBUG() << "InputContext::sendPreedit()"
+#ifdef SENSITIVE_DEBUG
+ << text << replaceFrom << replaceLength
+#endif
+ ;
bool textChanged = d->preeditText != text;
bool attributesChanged = d->preeditTextAttributes != attributes;
diff --git a/src/virtualkeyboard/lipiinputmethod.cpp b/src/virtualkeyboard/lipiinputmethod.cpp
index 4f832573..0d0c48b5 100644
--- a/src/virtualkeyboard/lipiinputmethod.cpp
+++ b/src/virtualkeyboard/lipiinputmethod.cpp
@@ -773,7 +773,7 @@ void LipiInputMethod::timerEvent(QTimerEvent *timerEvent)
void LipiInputMethod::resultsAvailable(const QVariantList &resultList)
{
-#ifdef QT_VIRTUALKEYBOARD_DEBUG
+#ifdef SENSITIVE_DEBUG
{
VIRTUALKEYBOARD_DEBUG() << "LipiInputMethod::resultsAvailable():";
for (int i = 0; i < resultList.size(); i++) {
diff --git a/src/virtualkeyboard/t9writeinputmethod.cpp b/src/virtualkeyboard/t9writeinputmethod.cpp
index a2f45c18..3abac7ae 100644
--- a/src/virtualkeyboard/t9writeinputmethod.cpp
+++ b/src/virtualkeyboard/t9writeinputmethod.cpp
@@ -1280,7 +1280,7 @@ void T9WriteInputMethod::dictionaryLoadCompleted(const QString &fileUri, void *d
void T9WriteInputMethod::resultsAvailable(const QVariantList &resultList)
{
-#ifdef QT_VIRTUALKEYBOARD_DEBUG
+#ifdef SENSITIVE_DEBUG
{
VIRTUALKEYBOARD_DEBUG() << "T9WriteInputMethod::resultsAvailable():";
for (int i = 0; i < resultList.size(); i++) {
diff --git a/src/virtualkeyboard/t9writeworker.cpp b/src/virtualkeyboard/t9writeworker.cpp
index 53422a6c..955eb9f7 100644
--- a/src/virtualkeyboard/t9writeworker.cpp
+++ b/src/virtualkeyboard/t9writeworker.cpp
@@ -138,7 +138,9 @@ T9WriteRecognitionTask::T9WriteRecognitionTask(QSharedPointer<T9WriteRecognition
stringStart(stringStart),
stateCancelled(false)
{
+#ifdef SENSITIVE_DEBUG
VIRTUALKEYBOARD_DEBUG() << "T9WriteRecognitionTask():" << "boostLevel:" << boostLevel << "stringStart:" << stringStart;
+#endif
}
void T9WriteRecognitionTask::run()
diff --git a/src/virtualkeyboard/virtualkeyboarddebug.h b/src/virtualkeyboard/virtualkeyboarddebug.h
index 49c3e932..b4a1262f 100644
--- a/src/virtualkeyboard/virtualkeyboarddebug.h
+++ b/src/virtualkeyboard/virtualkeyboarddebug.h
@@ -24,9 +24,7 @@
#include <QDebug>
-// Enables logging of sensitive information, such as key events.
-// Should never be enabled by default.
-//#define SENSITIVE_DEBUG
+// See config.pri for SENSITIVE_DEBUG.
//#define QT_VIRTUALKEYBOARD_DEBUG
#ifdef QT_VIRTUALKEYBOARD_DEBUG