diff --git a/src/plugins/phabricator/phabricatorjobs.cpp b/src/plugins/phabricator/phabricatorjobs.cpp --- a/src/plugins/phabricator/phabricatorjobs.cpp +++ b/src/plugins/phabricator/phabricatorjobs.cpp @@ -35,7 +35,9 @@ #include -#define COLOURCODES "\u001B\[[0-9]*m" +namespace { +QString COLORCODES() { return QStringLiteral("\u001B\\[[0-9]*m"); } +} using namespace Phabricator; @@ -101,25 +103,25 @@ void DifferentialRevision::setErrorString(const QString& msg) { - QRegExp unwanted(QString::fromUtf8(COLOURCODES)); + QRegExp unwanted(COLORCODES()); m_errorString = msg; m_errorString.replace(unwanted, QString()); } QString DifferentialRevision::scrubbedResult() { QString result = QString::fromUtf8(m_arcCmd.readAllStandardOutput()); // the return string can contain terminal text colour codes: remove them. - QRegExp unwanted(QString::fromUtf8(COLOURCODES)); + QRegExp unwanted(COLORCODES()); result.replace(unwanted, QString()); return result; } QStringList DifferentialRevision::scrubbedResultList() { QStringList result = QString::fromUtf8(m_arcCmd.readAllStandardOutput()).split(QChar::LineFeed); // the return string can contain terminal text colour codes: remove them. - QRegExp unwanted(QString::fromUtf8(COLOURCODES)); + QRegExp unwanted(COLORCODES()); result.replaceInStrings(unwanted, QString()); // remove all (now) empty strings result.removeAll(QString());