Merge branch 'issue640'

* issue640:
  Improve "Undecodable sequence" warnings
This commit is contained in:
Luís Pereira
2021-02-23 11:13:30 +00:00
3 changed files with 8 additions and 18 deletions
+3 -18
View File
@@ -22,6 +22,7 @@
// Own
#include "Vt102Emulation.h"
#include "tools.h"
// XKB
//#include <config-konsole.h>
@@ -45,6 +46,7 @@
#include <QEvent>
#include <QKeyEvent>
#include <QByteRef>
#include <QDebug>
// KDE
//#include <kdebug.h>
@@ -1363,28 +1365,11 @@ char Vt102Emulation::eraseChar() const
return '\b';
}
// print contents of the scan buffer
static void hexdump(wchar_t* s, int len)
{ int i;
for (i = 0; i < len; i++)
{
if (s[i] == '\\')
printf("\\\\");
else
if ((s[i]) > 32 && s[i] < 127)
printf("%c",s[i]);
else
printf("\\%04x(hex)",s[i]);
}
}
void Vt102Emulation::reportDecodingError()
{
if (tokenBufferPos == 0 || ( tokenBufferPos == 1 && (tokenBuffer[0] & 0xff) >= 32) )
return;
printf("Undecodable sequence: ");
hexdump(tokenBuffer,tokenBufferPos);
printf("\n");
qCDebug(qtermwidgetLogger) << "Undecodable sequence:" << QString::fromWCharArray(tokenBuffer, tokenBufferPos);
}
//#include "Vt102Emulation.moc"
+2
View File
@@ -5,6 +5,8 @@
#include <QtDebug>
Q_LOGGING_CATEGORY(qtermwidgetLogger, "qtermwidget", QtWarningMsg)
/*! Helper function to get possible location of layout files.
By default the KB_LAYOUT_DIR is used (linux/BSD/macports).
But in some cases (apple bundle) there can be more locations).
+3
View File
@@ -3,9 +3,12 @@
#include <QString>
#include <QStringList>
#include <QLoggingCategory>
QString get_kb_layout_dir();
void add_custom_color_scheme_dir(const QString& custom_dir);
const QStringList get_color_schemes_dirs();
Q_DECLARE_LOGGING_CATEGORY(qtermwidgetLogger)
#endif