mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
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:
@@ -31,7 +31,8 @@ PhysicalTerminal::PhysicalTerminal(TerminalStrip *parent_strip,
|
||||
m_parent_terminal_strip(parent_strip),
|
||||
m_real_terminal(terminals)
|
||||
{
|
||||
for (const auto &real_t : m_real_terminal) {
|
||||
for (const auto& real_t : std::as_const(m_real_terminal))
|
||||
{
|
||||
if (real_t) {
|
||||
real_t->setPhysicalTerminal(sharedRef());
|
||||
}
|
||||
@@ -86,7 +87,8 @@ QDomElement PhysicalTerminal::toXml(QDomDocument &parent_document) const
|
||||
*/
|
||||
void PhysicalTerminal::setTerminals(const QVector<QSharedPointer<RealTerminal>> &terminals) {
|
||||
m_real_terminal = terminals;
|
||||
for (const auto &real_t : m_real_terminal) {
|
||||
for (const auto& real_t : std::as_const(m_real_terminal))
|
||||
{
|
||||
if (real_t) {
|
||||
real_t->setPhysicalTerminal(sharedRef());
|
||||
}
|
||||
@@ -148,7 +150,8 @@ void PhysicalTerminal::setParentStrip(TerminalStrip *strip)
|
||||
|
||||
PhysicalTerminal::~PhysicalTerminal()
|
||||
{
|
||||
for (const auto &real_t : m_real_terminal) {
|
||||
for (const auto& real_t : std::as_const(m_real_terminal))
|
||||
{
|
||||
if (real_t) {
|
||||
real_t->setPhysicalTerminal(QSharedPointer<PhysicalTerminal>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user