mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-04-17 06:31:26 +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 found = false;
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
|
|
||||||
for (const QString &line : lines) {
|
for (const QString &line : std::as_const(lines)) {
|
||||||
QString trimmedLine = line.trimmed();
|
QString trimmedLine = line.trimmed();
|
||||||
if (trimmedLine.contains("[")) {
|
if (trimmedLine.contains("[")) {
|
||||||
skip = true;
|
skip = true;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk)
|
void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk)
|
||||||
{
|
{
|
||||||
QList<QAbstractButton*> buttons = buttonGroup->buttons();
|
QList<QAbstractButton*> buttons = buttonGroup->buttons();
|
||||||
for (QAbstractButton* button : buttons) {
|
for (QAbstractButton* button : std::as_const(buttons)) {
|
||||||
buttonGroup->removeButton(button);
|
buttonGroup->removeButton(button);
|
||||||
delete button;
|
delete button;
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ QString utils::getSmartctlPath() {
|
|||||||
|
|
||||||
paths << "/usr/sbin" << "/usr/local/sbin";
|
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");
|
QString absolutePath = QDir(path).absoluteFilePath("smartctl");
|
||||||
if (QFile::exists(absolutePath) && QFileInfo(absolutePath).isExecutable()) {
|
if (QFile::exists(absolutePath) && QFileInfo(absolutePath).isExecutable()) {
|
||||||
return absolutePath;
|
return absolutePath;
|
||||||
|
|||||||
Reference in New Issue
Block a user