Source Code (Use browser search to find items of interest.)
Class Index
ktop'HostInfo (./kdeutils/ktop/gui/SensorBrowser.h:74)
class HostInfo
{
public:
HostInfo(const QString& n, QListViewItem* l) : hostName(n), lvi(l)
{
sensors.setAutoDelete(TRUE);
}
~HostInfo() { }
const QString& getHostName()
{
return (hostName);
}
QListViewItem* getLVI()
{
return (lvi);
}
const QString& getSensorName(const QListViewItem* lvi)
{
QListIterator<SensorInfo> it(sensors);
for ( ; it.current() && (*it)->getLVI() != lvi; ++it)
;
assert(it.current());
return ((*it)->getName());
}
const QString& getSensorType(const QListViewItem* lvi)
{
QListIterator<SensorInfo> it(sensors);
for ( ; it.current() && (*it)->getLVI() != lvi; ++it)
;
assert(it.current());
return ((*it)->getType());
}
void addSensor(QListViewItem* lvi, const QString& name,
const QString& descr, const QString& type)
{
SensorInfo* si = new SensorInfo(lvi, name, descr, type);
CHECK_PTR(si);
sensors.append(si);
}
private:
QString hostName;
/// pointer to the entry in the browser QListView
QListViewItem* lvi;
QList<SensorInfo> sensors;
} ;
/**
* The SensorBrowser is the graphical front-end of the SensorManager. It
* displays the currently available hosts and their sensors.
*/