mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-07 11:59:57 +03:00
Use as_const on the rest of the source files
This commit is contained in:
@@ -9,7 +9,7 @@ QVector<QPair<QString, int>> JsonParser::parse(const QString &json)
|
||||
bool found = false;
|
||||
bool skip = false;
|
||||
|
||||
for (const QString &line : lines) {
|
||||
for (const QString &line : std::as_const(lines)) {
|
||||
QString trimmedLine = line.trimmed();
|
||||
if (trimmedLine.contains("[")) {
|
||||
skip = true;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk)
|
||||
{
|
||||
QList<QAbstractButton*> buttons = buttonGroup->buttons();
|
||||
for (QAbstractButton* button : buttons) {
|
||||
for (QAbstractButton* button : std::as_const(buttons)) {
|
||||
buttonGroup->removeButton(button);
|
||||
delete button;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ QString utils::getSmartctlPath() {
|
||||
|
||||
paths << "/usr/sbin" << "/usr/local/sbin";
|
||||
|
||||
for (const QString &path : paths) {
|
||||
for (const QString &path : std::as_const(paths)) {
|
||||
QString absolutePath = QDir(path).absoluteFilePath("smartctl");
|
||||
if (QFile::exists(absolutePath) && QFileInfo(absolutePath).isExecutable()) {
|
||||
return absolutePath;
|
||||
|
||||
Reference in New Issue
Block a user