debugger: some encoding correctness

This commit is contained in:
hjk
2009-05-29 10:35:04 +02:00
parent b390e56d67
commit 957a8f3479
8 changed files with 19 additions and 12 deletions

View File

@@ -89,6 +89,8 @@ LIBS += -L$$IDE_LIBRARY_PATH
# DEFINES += QT_NO_CAST_FROM_ASCII # DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII DEFINES += QT_NO_CAST_TO_ASCII
DEFINES += QT_USE_STRINGBUILDER_FOR_CONCATENATION
DEFINES += QT_USE_OPERATOR_PLUS_FOR_CONCATENATION
unix { unix {
debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared

View File

@@ -190,9 +190,10 @@ void SavedAction::setTextPattern(const QString &value)
QString SavedAction::toString() const QString SavedAction::toString() const
{ {
return "value: " + m_value.toString() return QLatin1String("value: ") + m_value.toString()
+ " defaultvalue: " + m_defaultValue.toString() + QLatin1String(" defaultvalue: ") + m_defaultValue.toString()
+ " settingskey: " + m_settingsGroup + '/' + m_settingsKey; + QLatin1String(" settingskey: ") + m_settingsGroup
+ '/' + m_settingsKey;
} }
/*! /*!

View File

@@ -1,6 +1,9 @@
TEMPLATE = lib TEMPLATE = lib
TARGET = Debugger TARGET = Debugger
#DEFINES += QT_USE_FAST_OPERATOR_PLUS
#DEFINES += QT_USE_FAST_CONCATENATION
# CONFIG += single # CONFIG += single
include(../../qtcreatorplugin.pri) include(../../qtcreatorplugin.pri)
include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/projectexplorer/projectexplorer.pri)

View File

@@ -653,7 +653,7 @@ void DebuggerManager::showStatusMessage(const QString &msg, int timeout)
if (Debugger::Constants::Internal::debug) if (Debugger::Constants::Internal::debug)
qDebug() << "STATUS MSG: " << msg; qDebug() << "STATUS MSG: " << msg;
showDebuggerOutput("status:", msg); showDebuggerOutput("status:", msg);
m_statusLabel->setText(" " + msg); m_statusLabel->setText(QLatin1String(" ") + msg);
if (timeout > 0) { if (timeout > 0) {
m_statusTimer->setSingleShot(true); m_statusTimer->setSingleShot(true);
m_statusTimer->start(timeout); m_statusTimer->start(timeout);

View File

@@ -181,7 +181,7 @@ public slots:
void gotoResult(int i) void gotoResult(int i)
{ {
QString needle = QString::number(i) + '^'; QString needle = QString::number(i) + '^';
QString needle2 = "stdout:" + needle; QString needle2 = QLatin1String("stdout:") + needle;
QTextCursor cursor(document()); QTextCursor cursor(document());
do { do {
const QString line = cursor.block().text(); const QString line = cursor.block().text();

View File

@@ -358,8 +358,9 @@ void TcfEngine::handleResponse(const QByteArray &response)
int token = parts.at(1).toInt(); int token = parts.at(1).toInt();
QByteArray message = parts.at(2); QByteArray message = parts.at(2);
JsonValue data(parts.at(3)); JsonValue data(parts.at(3));
emit tcfOutputAvailable("", QString::number(token) + "^" emit tcfOutputAvailable("", QString("%1^%2%3").arg(token)
+ quoteUnprintableLatin1(response) + data.toString()); .arg(quoteUnprintableLatin1(response))
.arg(QString::fromUtf8(data.toString())));
TcfCommand tcf = m_cookieForToken[token]; TcfCommand tcf = m_cookieForToken[token];
JsonValue result(data); JsonValue result(data);
SDEBUG("GOOD RESPONSE: " << quoteUnprintableLatin1(response)); SDEBUG("GOOD RESPONSE: " << quoteUnprintableLatin1(response));

View File

@@ -595,9 +595,9 @@ QVariant WatchHandler::headerData(int section, Qt::Orientation orientation,
return QVariant(); return QVariant();
if (role == Qt::DisplayRole) { if (role == Qt::DisplayRole) {
switch (section) { switch (section) {
case 0: return tr("Name") + QLatin1String(" "); case 0: return QString(tr("Name") + QLatin1String(" "));
case 1: return tr("Value") + QLatin1String(" "); case 1: return QString(tr("Value") + QLatin1String(" "));
case 2: return tr("Type") + QLatin1String(" "); case 2: return QString(tr("Type") + QLatin1String(" "));
} }
} }
return QVariant(); return QVariant();

View File

@@ -89,10 +89,10 @@ public:
model->setData(index, value, Qt::EditRole); model->setData(index, value, Qt::EditRole);
if (index.column() == 1) { if (index.column() == 1) {
// the value column // the value column
theDebuggerAction(AssignValue)->trigger(exp + '=' + value); theDebuggerAction(AssignValue)->trigger(QString(exp + '=' + value));
} else if (index.column() == 2) { } else if (index.column() == 2) {
// the type column // the type column
theDebuggerAction(AssignType)->trigger(exp + '=' + value); theDebuggerAction(AssignType)->trigger(QString(exp + '=' + value));
} else if (index.column() == 0) { } else if (index.column() == 0) {
// the watcher name column // the watcher name column
theDebuggerAction(RemoveWatchExpression)->trigger(exp); theDebuggerAction(RemoveWatchExpression)->trigger(exp);