mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
fix custom command
This commit is contained in:
parent
79cbfc4b32
commit
c659f16d7e
@ -152,7 +152,8 @@ void ExtendedSysMon::setProcesses()
|
|||||||
// custom
|
// custom
|
||||||
for (int i=0; i<configuration[QString("CUSTOM")].split(QString("@@"), QString::SkipEmptyParts).count(); i++) {
|
for (int i=0; i<configuration[QString("CUSTOM")].split(QString("@@"), QString::SkipEmptyParts).count(); i++) {
|
||||||
processes[QString("custom")].append(new QProcess);
|
processes[QString("custom")].append(new QProcess);
|
||||||
connect(processes[QString("custom")][i], SIGNAL(readyReadStandardOutput()), this, SLOT(setCustomCmd()));
|
connect(processes[QString("custom")][i], SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||||
|
this, SLOT(setCustomCmd(int, QProcess::ExitStatus)));
|
||||||
}
|
}
|
||||||
// gpu
|
// gpu
|
||||||
processes[QString("gpu")].append(new QProcess);
|
processes[QString("gpu")].append(new QProcess);
|
||||||
@ -261,9 +262,12 @@ void ExtendedSysMon::getCustomCmd(const QString cmd, const int number)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExtendedSysMon::setCustomCmd()
|
void ExtendedSysMon::setCustomCmd(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(exitStatus)
|
||||||
|
|
||||||
if (debug) qDebug() << "[DE]" << "[setCustomCmd]";
|
if (debug) qDebug() << "[DE]" << "[setCustomCmd]";
|
||||||
|
if (debug) qDebug() << "[DE]" << "[setCustomCmd]" << ":" << "Cmd returns" << exitCode;
|
||||||
for (int i=0; i<processes[QString("custom")].count(); i++) {
|
for (int i=0; i<processes[QString("custom")].count(); i++) {
|
||||||
QString value = QString("");
|
QString value = QString("");
|
||||||
value = QTextCodec::codecForMib(106)->toUnicode(processes[QString("custom")][i]->readAllStandardOutput()).trimmed();
|
value = QTextCodec::codecForMib(106)->toUnicode(processes[QString("custom")][i]->readAllStandardOutput()).trimmed();
|
||||||
@ -647,10 +651,10 @@ void ExtendedSysMon::setUpgradeInfo(int exitCode, QProcess::ExitStatus exitStatu
|
|||||||
|
|
||||||
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]";
|
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]";
|
||||||
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]" << ":" << "Cmd returns" << exitCode;
|
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]" << ":" << "Cmd returns" << exitCode;
|
||||||
int pkgNull = 0;
|
|
||||||
int value = 0;
|
|
||||||
QString qoutput = QString("");
|
|
||||||
for (int i=0; i<processes[QString("pkg")].count(); i++) {
|
for (int i=0; i<processes[QString("pkg")].count(); i++) {
|
||||||
|
int pkgNull = 0;
|
||||||
|
int value = 0;
|
||||||
|
QString qoutput = QString("");
|
||||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(processes[QString("pkg")][i]->readAllStandardOutput()).trimmed();
|
qoutput = QTextCodec::codecForMib(106)->toUnicode(processes[QString("pkg")][i]->readAllStandardOutput()).trimmed();
|
||||||
if (!qoutput.isEmpty()) {
|
if (!qoutput.isEmpty()) {
|
||||||
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]" << ":" << "Found data for cmd" << i;
|
if (debug) qDebug() << "[DE]" << "[setUpgradeInfo]" << ":" << "Found data for cmd" << i;
|
||||||
|
@ -47,7 +47,7 @@ protected:
|
|||||||
QStringList sources() const;
|
QStringList sources() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setCustomCmd();
|
void setCustomCmd(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
void setGpu();
|
void setGpu();
|
||||||
void setGpuTemp();
|
void setGpuTemp();
|
||||||
void setHddTemp();
|
void setHddTemp();
|
||||||
|
Loading…
Reference in New Issue
Block a user