MCPcopy Create free account
hub / github.com/KDE/kdevelop / formatChanged

Method formatChanged

plugins/debuggercommon/mivariable.cpp:340–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338};
339
340void MIVariable::formatChanged()
341{
342 if(childCount())
343 {
344 for (TreeItem* item : std::as_const(childItems)) {
345 Q_ASSERT(dynamic_cast<MIVariable*>(item));
346 if (auto* var = qobject_cast<MIVariable*>(item)) {
347 var->setFormat(format());
348 }
349 }
350 return;
351 }
352
353 if (m_varobj.isEmpty() || !sessionIsAlive()) {
354 return;
355 }
356
357 constexpr auto commandType = VarSetFormat;
358 QString arguments = m_varobj + QLatin1Char{' '} + format2str(format());
359 if (auto customHandler = handlerOfSetFormatCommand())
360 m_debugSession->addCommand(commandType, std::move(arguments), std::move(customHandler));
361 else {
362 m_debugSession->addCommand(commandType, std::move(arguments), new SetFormatHandler(this));
363 }
364}
365
366QString MIVariable::formatValue(const QString &rawValue) const
367{

Callers 1

handleMethod · 0.45

Calls 4

formatFunction · 0.85
addCommandMethod · 0.60
setFormatMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected