Commit 2f51579f authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk
Browse files

Debugger: Fix string usages.



- Compile with QT_NO_CAST_FROM_ASCII.
- Remove single character string constants.

Change-Id: Icece98619b6c30e047d3fce00e6ae74bbcd53c67
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 0418e6dc
......@@ -182,7 +182,7 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
break;
case WatchpointAtAddress: { // Read/write, no space here
const unsigned size = bp.size ? bp.size : 1;
str << "r" << size << ' ' << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
str << 'r' << size << ' ' << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
}
break;
}
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "debuggeractions.h"
#include "debuggerconstants.h"
......@@ -551,8 +553,9 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item->setDefaultValue(true);
insertItem(ShowQmlObjectTree, item);
const QString qmlInspectorGroup = QLatin1String("QML.Inspector");
item = new SavedAction(this);
item->setSettingsKey("QML.Inspector", QLatin1String("QmlInspector.ShowAppOnTop"));
item->setSettingsKey(qmlInspectorGroup, QLatin1String("QmlInspector.ShowAppOnTop"));
item->setText(tr("Show Application On Top"));
item->setCheckable(true);
item->setDefaultValue(false);
......@@ -560,7 +563,7 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
insertItem(ShowAppOnTop, item);
item = new SavedAction(this);
item->setSettingsKey("QML.Inspector", QLatin1String("QmlInspector.FromQml"));
item->setSettingsKey(qmlInspectorGroup, QLatin1String("QmlInspector.FromQml"));
item->setText(tr("Apply Changes on Save"));
item->setCheckable(true);
item->setDefaultValue(false);
......@@ -611,7 +614,7 @@ QString DebuggerSettings::dump() const
const QString current = item->value().toString();
const QString default_ = item->defaultValue().toString();
ts << '\n' << key << ": " << current
<< " (default: " << default_ << ")";
<< " (default: " << default_ << ')';
if (current != default_)
ts << " ***";
}
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "debuggerplugin.h"
#include "debuggerstartparameters.h"
......@@ -563,7 +565,7 @@ void fillParameters(DebuggerStartParameters *sp, Profile *profile)
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
if (device) {
sp->connParams = device->sshParameters();
sp->remoteChannel = QString("%1:%2").arg(sp->connParams.host).arg(sp->connParams.port);
sp->remoteChannel = sp->connParams.host + QLatin1Char(':') + QString::number(sp->connParams.port);
}
}
......@@ -3398,7 +3400,7 @@ void DebuggerPluginPrivate::testPythonDumpers1()
{
m_testSuccess = true;
QString proFile = ICore::resourcePath()
+ "/../../tests/manual/debugger/simple/simple.pro";
+ QLatin1String("/../../tests/manual/debugger/simple/simple.pro");
testLoadProject(proFile, TestCallBack(this, "testPythonDumpers2"));
QVERIFY(m_testSuccess);
QTestEventLoop::instance().enterLoop(20);
......@@ -3430,7 +3432,7 @@ void DebuggerPluginPrivate::testStateMachine1()
{
m_testSuccess = true;
QString proFile = ICore::resourcePath()
+ "/../../tests/manual/debugger/simple/simple.pro";
+ QLatin1String("/../../tests/manual/debugger/simple/simple.pro");
testLoadProject(proFile, TestCallBack(this, "testStateMachine2"));
QVERIFY(m_testSuccess);
QTestEventLoop::instance().enterLoop(20);
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "coregdbadapter.h"
#include "debuggerstartparameters.h"
......@@ -94,7 +96,7 @@ void GdbCoreEngine::continueSetupEngine()
// Read executable from core.
ElfReader reader(coreFileName());
bool isCore = false;
m_executable = reader.readCoreName(&isCore);
m_executable = QString::fromLocal8Bit(reader.readCoreName(&isCore));
if (!isCore) {
showMessageBox(QMessageBox::Warning,
......@@ -212,7 +214,9 @@ void GdbCoreEngine::unpackCoreIfNeeded()
QProcess *process = new QProcess(this);
process->setWorkingDirectory(QDir::tempPath());
process->start("/usr/bin/lzop", QStringList() << "-o" << m_tempCoreName << "-x" << m_coreName);
QStringList arguments;
arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName;
process->start(QLatin1String("/usr/bin/lzop"), arguments);
connect(process, SIGNAL(finished(int)), SLOT(continueSetupEngine()));
}
......
......@@ -129,7 +129,7 @@ void GdbServerStarter::portListReady()
connect(&d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int)));
QByteArray cmd = "/usr/bin/gdbserver --attach :"
+ QByteArray::number(port) + " " + QByteArray::number(d->process.pid);
+ QByteArray::number(port) + ' ' + QByteArray::number(d->process.pid);
logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd)));
d->runner.run(cmd, d->device->sshParameters());
}
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "loadcoredialog.h"
#include "debuggerconstants.h"
......@@ -203,7 +205,7 @@ void SelectRemoteFileDialog::selectFile()
SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString)));
{
QTemporaryFile localFile(QDir::tempPath() + "/remotecore-XXXXXX");
QTemporaryFile localFile(QDir::tempPath() + QLatin1String("/remotecore-XXXXXX"));
localFile.open();
m_localFile = localFile.fileName();
}
......
......@@ -61,7 +61,7 @@ public:
#define DEMANGLER_ASSERT(cond) \
do { \
if (!(cond)) { \
throw InternalDemanglerException(Q_FUNC_INFO, __FILE__, __LINE__); \
throw InternalDemanglerException(QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__); \
} \
} while (0)
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "namedemangler.h"
#include "demanglerexceptions.h"
......@@ -61,7 +63,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
m_demangledName.clear();
if (!MangledNameRule::mangledRepresentationStartsWith(m_parseState.peek())) {
m_demangledName = m_parseState.m_mangledName;
m_demangledName = QLatin1String(m_parseState.m_mangledName);
return true;
}
......@@ -76,7 +78,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
// Uncomment for debugging.
//m_parseState.stackTop()->print(0);
m_demangledName = m_parseState.stackTop()->toByteArray();
m_demangledName = QLatin1String(m_parseState.stackTop()->toByteArray());
success = true;
} catch (const ParseException &p) {
m_errorString = QString::fromLocal8Bit("Parse error at index %1 of mangled name '%2': %3.")
......
......@@ -27,6 +27,9 @@
**
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "parsetreenodes.h"
#include "demanglerexceptions.h"
......@@ -50,7 +53,7 @@
#define PARSE_RULE_AND_ADD_RESULT_AS_CHILD(nodeType) \
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(nodeType, parseState(), this)
#define CHILD_AT(obj, index) obj->childAt(index, Q_FUNC_INFO, __FILE__, __LINE__)
#define CHILD_AT(obj, index) obj->childAt(index, QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__)
#define MY_CHILD_AT(index) CHILD_AT(this, index)
#define CHILD_TO_BYTEARRAY(index) MY_CHILD_AT(index)->toByteArray()
......@@ -693,7 +696,7 @@ void ExpressionNode::parse()
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != '_')
throw ParseException("Invalid expression");
throw ParseException(QLatin1String("Invalid expression"));
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TypeNode);
if (PEEK() == 'E')
ADVANCE();
......@@ -2074,7 +2077,7 @@ void NumberNode::parse()
{
const char next = PEEK();
if (!mangledRepresentationStartsWith(next))
throw ParseException("Invalid number");
throw ParseException(QLatin1String("Invalid number"));
if (next == 'n') {
m_isNegative = true;
......@@ -2799,15 +2802,15 @@ QByteArray LambdaSigNode::toByteArray() const
void ClosureTypeNameNode::parse()
{
if (parseState()->readAhead(2) != "Ul")
throw ParseException("Invalid closure-type-name");
throw ParseException(QLatin1String("Invalid closure-type-name"));
parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(LambdaSigNode);
if (ADVANCE() != 'E')
throw ParseException("invalid closure-type-name");
throw ParseException(QLatin1String("invalid closure-type-name"));
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_')
throw ParseException("Invalid closure-type-name");
throw ParseException(QLatin1String("Invalid closure-type-name"));
}
QByteArray ClosureTypeNameNode::toByteArray() const
......@@ -2841,7 +2844,7 @@ void UnnamedTypeNameNode::parse()
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_')
throw ParseException("Invalid unnamed-type-node");
throw ParseException(QLatin1String("Invalid unnamed-type-node"));
} else {
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ClosureTypeNameNode);
}
......@@ -2877,7 +2880,7 @@ void DeclTypeNode::parse()
{
const QByteArray start = parseState()->readAhead(2);
if (start != "DT" && start != "Dt")
throw ParseException("Invalid decltype");
throw ParseException(QLatin1String("Invalid decltype"));
parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != 'E')
......@@ -2913,7 +2916,7 @@ void UnresolvedTypeRule::parse(GlobalParseState *parseState)
else if (SubstitutionNode::mangledRepresentationStartsWith(next))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(SubstitutionNode, parseState, parentNode);
else
throw ParseException("Invalid unresolved-type");
throw ParseException(QLatin1String("Invalid unresolved-type"));
}
......@@ -2954,7 +2957,7 @@ void DestructorNameNode::parse()
else if (SimpleIdNode::mangledRepresentationStartsWith(next))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SimpleIdNode);
else
throw ParseException("Invalid destructor-name");
throw ParseException(QLatin1String("Invalid destructor-name"));
}
QByteArray DestructorNameNode::toByteArray() const
......@@ -3011,7 +3014,7 @@ void BaseUnresolvedNameNode::parse()
parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(DestructorNameNode);
} else {
throw ParseException("Invalid <base-unresolved-name>");
throw ParseException(QLatin1String("Invalid <base-unresolved-name>"));
}
}
......@@ -3038,12 +3041,12 @@ bool InitializerNode::mangledRepresentationStartsWith(char c)
void InitializerNode::parse()
{
if (parseState()->readAhead(2) != "pi")
throw ParseException("Invalid initializer");
throw ParseException(QLatin1String("Invalid initializer"));
parseState()->advance(2);
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
if (ADVANCE() != 'E')
throw ParseException("Invalid initializer");
throw ParseException(QLatin1String("Invalid initializer"));
}
QByteArray InitializerNode::toByteArray() const
......@@ -3093,20 +3096,20 @@ void UnresolvedNameNode::parse()
UnresolvedQualifierLevelRule::parse(parseState());
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()));
if (ADVANCE() != 'E')
throw ParseException("Invalid unresolev-name");
throw ParseException(QLatin1String("Invalid unresolved-name"));
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
} else if (UnresolvedTypeRule::mangledRepresentationStartsWith(PEEK())) {
if (m_globalNamespace)
throw ParseException("Invalid unresolved-name");
throw ParseException(QLatin1String("Invalid unresolved-name"));
UnresolvedTypeRule::parse(parseState());
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
} else {
if (!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
throw ParseException("Invalid unresolved-name");
throw ParseException(QLatin1String("Invalid unresolved-name"));
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
UnresolvedQualifierLevelRule::parse(parseState());
if (ADVANCE() != 'E')
throw ParseException("Invalid unresolved-name");
throw ParseException(QLatin1String("Invalid unresolved-name"));
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
}
} else {
......@@ -3152,19 +3155,19 @@ void FunctionParamNode::parse()
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_')
throw ParseException("Invalid function-param");
throw ParseException(QLatin1String("Invalid function-param"));
} else if (parseState()->readAhead(2) == "fL") {
parseState()->advance(2);
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != 'p')
throw ParseException("Invalid function-param");
throw ParseException(QLatin1String("Invalid function-param"));
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(CvQualifiersNode);
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
if (ADVANCE() != '_')
throw ParseException("Invalid function-param");
throw ParseException(QLatin1String("Invalid function-param"));
} else {
throw ParseException("Invalid function-param");
throw ParseException(QLatin1String("Invalid function-param"));
}
}
......
......@@ -361,7 +361,7 @@ void PdbEngine::handleBreakInsert(const PdbResponse &response)
int pos1 = response.data.indexOf(" at ");
QTC_ASSERT(pos1 != -1, return);
QByteArray bpnr = response.data.mid(11, pos1 - 11);
int pos2 = response.data.lastIndexOf(":");
int pos2 = response.data.lastIndexOf(':');
QByteArray file = response.data.mid(pos1 + 4, pos2 - pos1 - 4);
QByteArray line = response.data.mid(pos2 + 1);
BreakpointResponse br;
......@@ -630,7 +630,7 @@ void PdbEngine::handleOutput(const QByteArray &data)
{
//qDebug() << "READ: " << data;
m_inbuffer.append(data);
qDebug() << "BUFFER FROM: '" << m_inbuffer << "'";
qDebug() << "BUFFER FROM: '" << m_inbuffer << '\'';
while (true) {
int pos = m_inbuffer.indexOf("(Pdb)");
if (pos == -1)
......@@ -641,7 +641,7 @@ void PdbEngine::handleOutput(const QByteArray &data)
m_inbuffer = m_inbuffer.mid(pos + 6);
emit outputReady(response);
}
qDebug() << "BUFFER LEFT: '" << m_inbuffer << "'";
qDebug() << "BUFFER LEFT: '" << m_inbuffer << '\'';
//m_inbuffer.clear();
}
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "qmlinspectoradapter.h"
#include "debuggeractions.h"
......@@ -117,8 +119,8 @@ QmlInspectorAdapter::QmlInspectorAdapter(QmlAdapter *debugAdapter,
this, SLOT(toolsClientStatusChanged(QmlDebug::ClientStatus)));
// toolbar
m_selectAction->setObjectName("QML Select Action");
m_zoomAction->setObjectName("QML Zoom Action");
m_selectAction->setObjectName(QLatin1String("QML Select Action"));
m_zoomAction->setObjectName(QLatin1String("QML Zoom Action"));
m_selectAction->setCheckable(true);
m_zoomAction->setCheckable(true);
......@@ -294,14 +296,14 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
QmlJS::ModelManagerInterface::instance();
QmlJS::Document::Ptr doc = modelManager->snapshot().document(filename);
if (!doc) {
if (filename.endsWith(".qml") || filename.endsWith(".js")) {
if (filename.endsWith(QLatin1String(".qml")) || filename.endsWith(QLatin1String(".js"))) {
// add to list of docs that we have to update when
// snapshot figures out that there's a new document
m_pendingPreviewDocumentNames.append(filename);
}
return;
}
if (!doc->qmlProgram() && !filename.endsWith(".js"))
if (!doc->qmlProgram() && !filename.endsWith(QLatin1String(".js")))
return;
QmlJS::Document::Ptr initdoc = m_loadedSnapshot.document(filename);
......
......@@ -28,6 +28,8 @@
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "qmlinspectoragent.h"
#include "debuggeractions.h"
......@@ -73,8 +75,8 @@ quint32 QmlInspectorAgent::queryExpressionResult(int debugId,
const QString &expression)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << debugId << expression
<< m_engine.debugId() << ")";
qDebug() << __FUNCTION__ << '(' << debugId << expression
<< m_engine.debugId() << ')';
return m_engineClient->queryExpressionResult(debugId, expression,
m_engine.debugId());
......@@ -84,7 +86,7 @@ void QmlInspectorAgent::assignValue(const WatchData *data,
const QString &expr, const QVariant &valueV)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << data->id << ")" << data->iname;
qDebug() << __FUNCTION__ << '(' << data->id << ')' << data->iname;
if (data->id) {
QString val(valueV.toString());
......@@ -100,7 +102,7 @@ void QmlInspectorAgent::assignValue(const WatchData *data,
void QmlInspectorAgent::updateWatchData(const WatchData &data)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << data.id << ")";
qDebug() << __FUNCTION__ << '(' << data.id << ')';
if (data.id && !m_fetchDataIds.contains(data.id)) {
// objects
......@@ -112,7 +114,7 @@ void QmlInspectorAgent::updateWatchData(const WatchData &data)
bool QmlInspectorAgent::selectObjectInTree(int debugId)
{
if (debug) {
qDebug() << __FUNCTION__ << "(" << debugId << ")";
qDebug() << __FUNCTION__ << '(' << debugId << ')';
qDebug() << " " << debugId << "already fetched? "
<< m_debugIdToIname.contains(debugId);
}
......@@ -141,8 +143,8 @@ quint32 QmlInspectorAgent::setBindingForObject(int objectDebugId,
int line)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << objectDebugId << propertyName
<< value.toString() << isLiteralValue << source << line << ")";
qDebug() << __FUNCTION__ << '(' << objectDebugId << propertyName
<< value.toString() << isLiteralValue << source << line << ')';
if (objectDebugId == -1)
return 0;
......@@ -154,16 +156,16 @@ quint32 QmlInspectorAgent::setBindingForObject(int objectDebugId,
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
return 0;
log(LogSend, QString("SET_BINDING %1 %2 %3 %4").arg(
log(LogSend, QString::fromLatin1("SET_BINDING %1 %2 %3 %4").arg(
QString::number(objectDebugId), propertyName, value.toString(),
QString(isLiteralValue ? "true" : "false")));
QString(isLiteralValue ? QLatin1String("true") : QLatin1String("false"))));
quint32 queryId = m_engineClient->setBindingForObject(
objectDebugId, propertyName, value.toString(), isLiteralValue,
source, line);
if (!queryId)
log(LogSend, QString("SET_BINDING failed!"));
log(LogSend, QLatin1String("SET_BINDING failed!"));
return queryId;
}
......@@ -173,8 +175,8 @@ quint32 QmlInspectorAgent::setMethodBodyForObject(int objectDebugId,
const QString &methodBody)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << objectDebugId
<< methodName << methodBody << ")";
qDebug() << __FUNCTION__ << '(' << objectDebugId
<< methodName << methodBody << ')';
if (objectDebugId == -1)
return 0;
......@@ -183,14 +185,14 @@ quint32 QmlInspectorAgent::setMethodBodyForObject(int objectDebugId,
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
return 0;
log(LogSend, QString("SET_METHOD_BODY %1 %2 %3").arg(
log(LogSend, QString::fromLatin1("SET_METHOD_BODY %1 %2 %3").arg(
QString::number(objectDebugId), methodName, methodBody));
quint32 queryId = m_engineClient->setMethodBody(
objectDebugId, methodName, methodBody);
if (!queryId)
log(LogSend, QString("failed!"));
log(LogSend, QLatin1String("failed!"));
return queryId;
}
......@@ -199,8 +201,8 @@ quint32 QmlInspectorAgent::resetBindingForObject(int objectDebugId,
const QString &propertyName)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << objectDebugId
<< propertyName << ")";
qDebug() << __FUNCTION__ << '(' << objectDebugId
<< propertyName << ')';
if (objectDebugId == -1)
return 0;
......@@ -209,14 +211,14 @@ quint32 QmlInspectorAgent::resetBindingForObject(int objectDebugId,
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
return 0;
log(LogSend, QString("RESET_BINDING %1 %2").arg(
log(LogSend, QString::fromLatin1("RESET_BINDING %1 %2").arg(
QString::number(objectDebugId), propertyName));
quint32 queryId = m_engineClient->resetBindingForObject(
objectDebugId, propertyName);
if (!queryId)
log(LogSend, QString("failed!"));
log(LogSend, QLatin1String("failed!"));
return queryId;
}
......@@ -291,7 +293,7 @@ QHash<int,QString> QmlInspectorAgent::rootObjectIds() const
if (!data)
continue;
int debugId = data->id;
QString className = data->type;
QString className = QLatin1String(data->type);
rIds.insert(debugId, className);
}
return rIds;
......@@ -300,7 +302,7 @@ QHash<int,QString> QmlInspectorAgent::rootObjectIds() const
bool QmlInspectorAgent::addObjectWatch(int objectDebugId)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << objectDebugId << ")";
qDebug() << __FUNCTION__ << '(' << objectDebugId << ')';
if (objectDebugId == -1)
return false;
......@@ -330,7 +332,7 @@ bool QmlInspectorAgent::isObjectBeingWatched(int objectDebugId)
bool QmlInspectorAgent::removeObjectWatch(int objectDebugId)
{
if (debug)
qDebug() << __FUNCTION__ << "(" << objectDebugId << ")";
qDebug() << __FUNCTION__ << '(' << objectDebugId << ')';
if (objectDebugId == -1)
return false;
......@@ -418,14 +420,14 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
if (debug)
qDebug() << __FUNCTION__ << "() ...";
if (type == _("FETCH_OBJECT_R")) {
if (type == "FETCH_OBJECT_R") {
log(LogReceive, _("FETCH_OBJECT_R %1").arg(
qvariant_cast<ObjectReference>(value).idString()));
} else if (type == _("SET_BINDING_R")
|| type == _("RESET_BINDING_R")
|| type == _("SET_METHOD_BODY_R")) {
} else if (type == "SET_BINDING_R"
|| type == "RESET_BINDING_R"
|| type == "SET_METHOD_BODY_R") {
QString msg = QLatin1String(type) + tr(" success : ");
msg += value.toBool() ? "1" : "0";
msg += value.toBool() ? QLatin1Char('1') : QLatin1Char('0');
if (!value.toBool())
emit automaticUpdateFailed();
log(LogReceive, msg);
......@@ -470,13 +472,13 @@ void QmlInspectorAgent::newObject(int engineId, int objectId, int /*parentId*/)
if (debug)
qDebug() << __FUNCTION__ << "()";
log(LogReceive, QString("OBJECT_CREATED"));
log(LogReceive, QLatin1String("OBJECT_CREATED"));
if (m_engine.debugId() != engineId)
return;
m_newObjectsCreated = true;
if (m_engineClient->objectName() == QmlDebug::Constants::QML_DEBUGGER)
if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER))
fetchObject(objectId);
else
m_delayQueryTimer.start();
......@@ -490,7 +492,7 @@ void QmlInspectorAgent::onValueChanged(int debugId, const QByteArray &propertyNa
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
const WatchData *data = watchHandler->findData(iname);
if (debug)
qDebug() << __FUNCTION__ << "(" << debugId << ")" << iname <<value.toString();
qDebug() << __FUNCTION__ << '(' << debugId