Try Clazy fix-its

clazy is a compiler plugin which allows clang to understand Qt
semantics. You get more than 50 Qt related compiler warnings, ranging
from unneeded memory allocations to misusage of API, including fix-its
for automatic refactoring.

https://invent.kde.org/sdk/clazy
This commit is contained in:
Laurent Trinques
2025-02-14 15:52:23 +01:00
parent adcf77e34a
commit dba7caed30
88 changed files with 512 additions and 409 deletions

View File

@@ -184,7 +184,7 @@ void AddTextsGroupCommand::redo()
}
else
{
for(DynamicElementTextItem *deti : m_deti_list)
for (DynamicElementTextItem* deti : std::as_const(m_deti_list))
m_element.data()->addTextToGroup(
deti,
m_group.data());
@@ -194,7 +194,7 @@ void AddTextsGroupCommand::redo()
else if(m_group)
{
m_element.data()->addTextGroup(m_group.data());
for(DynamicElementTextItem *deti : m_deti_list)
for (DynamicElementTextItem* deti : std::as_const(m_deti_list))
m_element.data()->addTextToGroup(deti, m_group.data());
}
}
@@ -236,8 +236,9 @@ void RemoveTextsGroupCommand::undo()
if(m_element && m_group)
{
m_element.data()->addTextGroup(m_group.data());
for(const QPointer<DynamicElementTextItem>& p : m_text_list)
for (const QPointer<DynamicElementTextItem>& p :
std::as_const(m_text_list))
if(p)
m_element.data()->addTextToGroup(
p.data(),
@@ -252,7 +253,8 @@ void RemoveTextsGroupCommand::redo()
{
if(m_element && m_group)
{
for(const QPointer<DynamicElementTextItem>& p : m_text_list)
for (const QPointer<DynamicElementTextItem>& p :
std::as_const(m_text_list))
if(p)
m_element.data()->removeTextFromGroup(
p.data(),