mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
fix hddtemp
This commit is contained in:
parent
b7d1802ca8
commit
c0561a95e0
@ -166,7 +166,8 @@ void ExtendedSysMon::setProcesses()
|
||||
// hddtemp
|
||||
for (int i=0; i<configuration[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts).count(); i++) {
|
||||
processes[QString("hddtemp")].append(new QProcess);
|
||||
connect(processes[QString("hddtemp")][i], SIGNAL(readyReadStandardOutput()), this, SLOT(setHddTemp()));
|
||||
connect(processes[QString("hddtemp")][i], SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||
this, SLOT(setHddTemp(int, QProcess::ExitStatus)));
|
||||
}
|
||||
// pkg
|
||||
for (int i=0; i<configuration[QString("PKGCMD")].split(QString(","), QString::SkipEmptyParts).count(); i++) {
|
||||
@ -399,18 +400,21 @@ void ExtendedSysMon::getHddTemp(const QString cmd, const QString device, const i
|
||||
}
|
||||
|
||||
|
||||
void ExtendedSysMon::setHddTemp()
|
||||
void ExtendedSysMon::setHddTemp(int exitCode, QProcess::ExitStatus exitStatus)
|
||||
{
|
||||
Q_UNUSED(exitStatus)
|
||||
|
||||
if (debug) qDebug() << "[DE]" << "[setHddTemp]";
|
||||
float value = 0.0;
|
||||
QString qoutput = QString("");
|
||||
if (debug) qDebug() << "[DE]" << "[setHddTemp]" << ":" << "Cmd returns" << exitCode;
|
||||
for (int i=0; i<processes[QString("hddtemp")].count(); i++) {
|
||||
float value = 0.0;
|
||||
QString qoutput = QString("");
|
||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(processes[QString("hddtemp")][i]->readAllStandardOutput()).trimmed();
|
||||
if (qoutput.split(QChar(':'), QString::SkipEmptyParts).count() >= 3) {
|
||||
if (debug) qDebug() << "[DE]" << "[setHddTemp]" << ":" << "Found data for cmd" << i;
|
||||
QString temp = qoutput.split(QChar(':'), QString::SkipEmptyParts)[2];
|
||||
temp.remove(QChar(0260)).remove(QChar('C'));
|
||||
value = temp.toFloat();
|
||||
if (debug) qDebug() << "[DE]" << "[setHddTemp]" << ":" << "Found data for cmd" << i;
|
||||
if (debug) qDebug() << "[DE]" << "[setHddTemp]" << ":" << "Return" << value;
|
||||
QString source = QString("hddtemp");
|
||||
QString key = configuration[QString("HDDDEV")].split(QChar(','), QString::SkipEmptyParts)[i];
|
||||
|
@ -50,7 +50,7 @@ private slots:
|
||||
void setCustomCmd(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void setGpu(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void setGpuTemp(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void setHddTemp();
|
||||
void setHddTemp(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void setUpgradeInfo(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void setPlayer();
|
||||
void setPs();
|
||||
|
Loading…
Reference in New Issue
Block a user