Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
core: Fix potential detach of non-const Qt containers
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
core: Fix potential detach of non-const Qt containers
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
From: https://www.kdab.com/goodbye-q_foreach/
Last, not least, if your container is a non-const lvalue, you have two choices: Make the container const, or, if that doesn’t work, use std::as_const() (new in C++17, but easily implemented yourself, if required) or qAsConst() (new in Qt 5.7) to cast to const:
There are two more instances you can do this with in atcore.cpp
line 245
for (const QSerialPortInfo &serialPortInfo : serialPortInfoList) {
and line 484
for (const QString &f : files) {