Commit 2be98206 authored by Pekka Vuorela's avatar Pekka Vuorela

Move charIsHexDigit as terminal implementation detail

parent 7457b8d9
......@@ -26,6 +26,18 @@
#include "textrender.h"
#include "util.h"
static bool charIsHexDigit(QChar ch)
{
if (ch.isDigit()) // 0-9
return true;
else if (ch.toLatin1() >= 65 && ch.toLatin1() <= 70) // A-F
return true;
else if (ch.toLatin1() >= 97 && ch.toLatin1() <= 102) // a-f
return true;
return false;
}
Terminal::Terminal(QObject *parent) :
QObject(parent), iPtyIFace(0), iWindow(0), iUtil(0),
iTermSize(0,0), iEmitCursorChangeSignal(true),
......@@ -133,7 +145,7 @@ void Terminal::putString(QString str, bool unEscape)
while(str.indexOf("\\x") != -1) {
int i = str.indexOf("\\x")+2;
QString num;
while(num.length() < 2 && str.length()>i && Util::charIsHexDigit(str.at(i))) {
while(num.length() < 2 && str.length()>i && charIsHexDigit(str.at(i))) {
num.append(str.at(i));
i++;
}
......
......@@ -375,16 +375,3 @@ bool Util::canPaste()
return !cb->text().isEmpty();
}
//static
bool Util::charIsHexDigit(QChar ch)
{
if (ch.isDigit()) // 0-9
return true;
else if (ch.toLatin1() >= 65 && ch.toLatin1() <= 70) // A-F
return true;
else if (ch.toLatin1() >= 97 && ch.toLatin1() <= 102) // a-f
return true;
return false;
}
......@@ -126,8 +126,6 @@ public:
bool showWelcomeScreen();
void setShowWelcomeScreen(bool value);
static bool charIsHexDigit(QChar ch);
signals:
void visualBell();
void notify(QString msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment