mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
fix cpu reading
This commit is contained in:
parent
0751d080eb
commit
cd48ac8245
@ -83,7 +83,6 @@ void AwesomeWidget::createActions()
|
||||
i18n("Update text"), this));
|
||||
connect(contextMenu[2], SIGNAL(triggered(bool)), extsysmonEngine, SLOT(updateAllSources()));
|
||||
connect(contextMenu[2], SIGNAL(triggered(bool)), sysmonEngine, SLOT(updateAllSources()));
|
||||
connect(contextMenu[2], SIGNAL(triggered(bool)), timeEngine, SLOT(updateAllSources()));
|
||||
connect(contextMenu[2], SIGNAL(triggered(bool)), this, SLOT(updateNetworkDevice()));
|
||||
}
|
||||
|
||||
@ -111,7 +110,7 @@ int AwesomeWidget::getNumberCpus()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QString cmd = QString("grep -c '^processor' /proc/cpuinfo");
|
||||
QString cmd = QString("grep -c ^processor /proc/cpuinfo");
|
||||
if (debug) qDebug() << PDEBUG << ":" << "cmd" << cmd;
|
||||
TaskResult process = runTask(cmd);
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cmd returns" << process.exitCode;
|
||||
|
@ -566,13 +566,13 @@ void AwesomeWidget::configChanged()
|
||||
QString fontStyle = cg.readEntry("fontStyle", "normal");
|
||||
formatLine[0] = QString("<html><head><meta name=\"qrichtext\" content=\"1\" />\
|
||||
<style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\
|
||||
</head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\"><pre>")
|
||||
</head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\">")
|
||||
.arg(fontFamily)
|
||||
.arg(QString::number(fontSize))
|
||||
.arg(QString::number(fontWeight))
|
||||
.arg(fontStyle)
|
||||
.arg(fontColor);
|
||||
formatLine[1] = QString("</pre></body></html>");
|
||||
formatLine[1] = QString("</body></html>");
|
||||
|
||||
// counts
|
||||
QMap<QString, QString> deSettings = readDataEngineConfiguration();
|
||||
|
@ -36,7 +36,7 @@ void AwesomeWidget::connectToEngine()
|
||||
// cpu
|
||||
sysmonEngine->connectSource(QString("cpu/system/TotalLoad"),
|
||||
this, configuration[QString("interval")].toInt());
|
||||
regExp = QRegExp(QString("cpu.*"));
|
||||
regExp = QRegExp(QString("cpu[0-9].*"));
|
||||
if (foundKeys.indexOf(regExp) > -1)
|
||||
for (int i=0; i<counts[QString("cpu")]; i++)
|
||||
sysmonEngine->connectSource(QString("cpu/cpu") + QString::number(i) + QString("/TotalLoad"),
|
||||
@ -44,7 +44,7 @@ void AwesomeWidget::connectToEngine()
|
||||
// cpuclock
|
||||
sysmonEngine->connectSource(QString("cpu/system/AverageClock"),
|
||||
this, configuration[QString("interval")].toInt());
|
||||
regExp = QRegExp(QString("cpucl.*"));
|
||||
regExp = QRegExp(QString("cpucl[0-9].*"));
|
||||
if (foundKeys.indexOf(regExp) > -1)
|
||||
for (int i=0; i<counts[QString("cpu")]; i++)
|
||||
sysmonEngine->connectSource(QString("cpu/cpu") + QString::number(i) + QString("/clock"),
|
||||
|
@ -56,9 +56,9 @@ void AwesomeWidget::reinit()
|
||||
textLabel->setPopupEnabled(true);
|
||||
updateText(true);
|
||||
mainLayout->addItem(textLabel);
|
||||
resize(10, 10);
|
||||
if (configuration[QString("rightStretch")].toInt() == 2)
|
||||
mainLayout->addStretch(1);
|
||||
resize(10, 10);
|
||||
|
||||
keys = getKeys();
|
||||
foundKeys = findKeys();
|
||||
|
Loading…
Reference in New Issue
Block a user