@@ -71,14 +71,14 @@ bool readIntegerFile(const QString &path, qint64 *value) {
7171}
7272
7373bool readFirstTemperatureFromHwmon (const QString &basePath, int *value) {
74- const QFileInfoList hwmonEntries =
75- QDir (basePath).entryInfoList ({QStringLiteral (" hwmon*" )},
76- QDir::Dirs | QDir::NoDotAndDotDot,
77- QDir::Name);
74+ const QFileInfoList hwmonEntries = QDir (basePath).entryInfoList (
75+ {QStringLiteral (" hwmon*" )}, QDir::Dirs | QDir::NoDotAndDotDot,
76+ QDir::Name);
7877 for (const QFileInfo &entry : hwmonEntries) {
79- const QFileInfoList inputs = QDir (entry.absoluteFilePath ())
80- .entryInfoList ({QStringLiteral (" temp*_input" )},
81- QDir::Files, QDir::Name);
78+ const QFileInfoList inputs =
79+ QDir (entry.absoluteFilePath ())
80+ .entryInfoList ({QStringLiteral (" temp*_input" )}, QDir::Files,
81+ QDir::Name);
8282 for (const QFileInfo &input : inputs) {
8383 qint64 milliC = 0 ;
8484 if (readIntegerFile (input.absoluteFilePath (), &milliC) && milliC > 0 ) {
@@ -94,9 +94,9 @@ bool readFirstTemperatureFromHwmon(const QString &basePath, int *value) {
9494bool readGenericLinuxGpuMetrics (int *temperatureC, int *utilizationPercent,
9595 int *memoryUsedMiB, int *memoryTotalMiB) {
9696 const QFileInfoList cardEntries =
97- QDir (drmRootPath ()). entryInfoList ({ QStringLiteral ( " card* " )},
98- QDir::Dirs | QDir::NoDotAndDotDot ,
99- QDir::Name);
97+ QDir (drmRootPath ())
98+ . entryInfoList ({ QStringLiteral ( " card* " )} ,
99+ QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
100100
101101 bool anyMetric = false ;
102102 for (const QFileInfo &cardEntry : cardEntries) {
@@ -117,19 +117,16 @@ bool readGenericLinuxGpuMetrics(int *temperatureC, int *utilizationPercent,
117117 if (utilizationPercent != nullptr &&
118118 readIntegerFile (devicePath + QStringLiteral (" /gpu_busy_percent" ),
119119 &busyPercent)) {
120- *utilizationPercent =
121- std::clamp (static_cast <int >(busyPercent), 0 , 100 );
120+ *utilizationPercent = std::clamp (static_cast <int >(busyPercent), 0 , 100 );
122121 anyMetric = true ;
123122 }
124123
125124 qint64 usedBytes = 0 ;
126125 qint64 totalBytes = 0 ;
127- const bool usedOk =
128- readIntegerFile (devicePath + QStringLiteral (" /mem_info_vram_used" ),
129- &usedBytes);
130- const bool totalOk =
131- readIntegerFile (devicePath + QStringLiteral (" /mem_info_vram_total" ),
132- &totalBytes);
126+ const bool usedOk = readIntegerFile (
127+ devicePath + QStringLiteral (" /mem_info_vram_used" ), &usedBytes);
128+ const bool totalOk = readIntegerFile (
129+ devicePath + QStringLiteral (" /mem_info_vram_total" ), &totalBytes);
133130 if (usedOk && totalOk && totalBytes > 0 ) {
134131 if (memoryUsedMiB != nullptr ) {
135132 *memoryUsedMiB =
0 commit comments