mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 16:07:19 +00:00
fix ps
This commit is contained in:
parent
ea287c21b1
commit
926da88c10
@ -182,10 +182,10 @@ void ExtendedSysMon::setProcesses()
|
|||||||
// ps
|
// ps
|
||||||
// pscount && ps
|
// pscount && ps
|
||||||
processes[QString("ps")].append(new QProcess);
|
processes[QString("ps")].append(new QProcess);
|
||||||
connect(processes[QString("ps")][0], SIGNAL(readyReadStandardOutput()), this, SLOT(setPs()));
|
|
||||||
// pstotal
|
// pstotal
|
||||||
processes[QString("ps")].append(new QProcess);
|
processes[QString("ps")].append(new QProcess);
|
||||||
connect(processes[QString("ps")][1], SIGNAL(readyReadStandardOutput()), this, SLOT(setPs()));
|
connect(processes[QString("ps")][1], SIGNAL(finished(int, QProcess::ExitStatus)),
|
||||||
|
this, SLOT(setPs(int, QProcess::ExitStatus)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -588,9 +588,12 @@ void ExtendedSysMon::getPsStats()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExtendedSysMon::setPs()
|
void ExtendedSysMon::setPs(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(exitStatus)
|
||||||
|
|
||||||
if (debug) qDebug() << "[DE]" << "[setPs]";
|
if (debug) qDebug() << "[DE]" << "[setPs]";
|
||||||
|
if (debug) qDebug() << "[DE]" << "[setPs]" << ":" << "Cmd returns" << exitCode;
|
||||||
QString qoutput = QString("");
|
QString qoutput = QString("");
|
||||||
for (int i=0; i<processes[QString("ps")].count(); i++) {
|
for (int i=0; i<processes[QString("ps")].count(); i++) {
|
||||||
qoutput = QTextCodec::codecForMib(106)->toUnicode(processes[QString("ps")][i]->readAllStandardOutput()).trimmed();
|
qoutput = QTextCodec::codecForMib(106)->toUnicode(processes[QString("ps")][i]->readAllStandardOutput()).trimmed();
|
||||||
@ -600,7 +603,8 @@ void ExtendedSysMon::setPs()
|
|||||||
// pscount && ps
|
// pscount && ps
|
||||||
QStringList psList;
|
QStringList psList;
|
||||||
for (int i=0; i<qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); i++)
|
for (int i=0; i<qoutput.split(QChar('\n'), QString::SkipEmptyParts).count(); i++)
|
||||||
if (qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i] != QString("ps --no-headers -o command"))
|
if (!qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i].
|
||||||
|
contains(QString("ps ")))
|
||||||
psList.append(qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i]);
|
psList.append(qoutput.split(QChar('\n'), QString::SkipEmptyParts)[i]);
|
||||||
QString source = QString("ps");
|
QString source = QString("ps");
|
||||||
QString key = QString("psCount");
|
QString key = QString("psCount");
|
||||||
|
@ -53,7 +53,7 @@ private slots:
|
|||||||
void setHddTemp(int exitCode, QProcess::ExitStatus exitStatus);
|
void setHddTemp(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
void setUpgradeInfo(int exitCode, QProcess::ExitStatus exitStatus);
|
void setUpgradeInfo(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
void setPlayer(int exitCode, QProcess::ExitStatus exitStatus);
|
void setPlayer(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
void setPs();
|
void setPs(int exitCode, QProcess::ExitStatus exitStatus);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// processes
|
// processes
|
||||||
|
Loading…
Reference in New Issue
Block a user