[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/dataengines/systemmonitor
From: Trever Fischer <wm161 () wm161 ! net>
Date: 2009-02-14 19:07:25
Message-ID: 1234638445.604359.24213.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 926167 by tdfischer:
Put the metadata into the model at the start, allowing us to actually show a list of \
translated sensor names without havingto make a ton of requests for updates.
M +6 -3 systemmonitor.cpp
--- trunk/KDE/kdebase/workspace/plasma/dataengines/systemmonitor/systemmonitor.cpp \
#926166:926167 @@ -54,7 +54,7 @@
bool SystemMonitorEngine::updateSourceEvent(const QString &sensorName)
{
KSGRD::SensorMgr->sendRequest( "localhost", sensorName, \
(KSGRD::SensorClient*)this, m_sensors.indexOf(sensorName));
- KSGRD::SensorMgr->sendRequest( "localhost", QString("%1?").arg(sensorName), \
(KSGRD::SensorClient*)this, -m_sensors.indexOf(sensorName)-1); + \
KSGRD::SensorMgr->sendRequest( "localhost", QString("%1?").arg(sensorName), \
(KSGRD::SensorClient*)this, -(m_sensors.indexOf(sensorName)+2)); return false;
}
@@ -81,23 +81,26 @@
QString max = newSensorInfo[2];
QString unit = newSensorInfo[3];
DataEngine::SourceDict sources = containerDict();
- DataEngine::SourceDict::const_iterator it = \
sources.constFind(m_sensors.value(-id-1)); + \
DataEngine::SourceDict::const_iterator it = \
sources.constFind(m_sensors.value(-id-2)); if (it != sources.constEnd()) {
it.value()->setData("name", sensorName);
it.value()->setData("min", min);
it.value()->setData("max", max);
it.value()->setData("units", unit);
+ scheduleSourcesUpdated();
}
return;
}
if(id==-1) {
QStringList sensors;
- foreach(const QByteArray &sens, answer) {
+ foreach(const QByteArray &sens, answer) {
QStringList newSensorInfo = QString::fromUtf8(sens).split('\t');
QString newSensor = newSensorInfo[0];
sensors.append(newSensor);
setData(newSensor, "value", QVariant());
setData(newSensor, "type", newSensorInfo[1]);
+
+ KSGRD::SensorMgr->sendRequest( "localhost", \
QString("%1?").arg(newSensor), (KSGRD::SensorClient*)this, \
-(sensors.indexOf(newSensor)+2)); }
m_sensors = sensors;
return;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic