RouterListItem Class Reference

#include <routerlistitem.h>

List of all members.

Public Member Functions

 RouterListItem (RouterListWidget *list, RouterDescriptor rd)
 ~RouterListItem ()
void update (const RouterDescriptor &rd)
QString id () const
QString name () const
RouterDescriptor descriptor () const
void setLocation (const GeoIp &geoip)
virtual bool operator< (const QTreeWidgetItem &other) const

Private Attributes

RouterDescriptor_rd
RouterListWidget_list
qint64 _statusValue
QString _country


Detailed Description

Definition at line 31 of file routerlistitem.h.


Constructor & Destructor Documentation

RouterListItem::RouterListItem ( RouterListWidget list,
RouterDescriptor  rd 
)

Default constructor.

Definition at line 36 of file routerlistitem.cpp.

References _country, _list, _rd, COUNTRY_COLUMN, IMG_FLAG_UNKNOWN, and update().

RouterListItem::~RouterListItem (  ) 

Destructor.

Definition at line 47 of file routerlistitem.cpp.

References _rd.


Member Function Documentation

RouterDescriptor RouterListItem::descriptor (  )  const [inline]

Returns the descriptor for this router.

Definition at line 48 of file routerlistitem.h.

References _rd.

QString RouterListItem::id (  )  const [inline]

Returns the router's ID.

Definition at line 44 of file routerlistitem.h.

References _rd, and RouterDescriptor::id().

Referenced by RouterListWidget::customContextMenuRequested(), and NetViewer::resolved().

QString RouterListItem::name (  )  const [inline]

Returns the router's name.

Definition at line 46 of file routerlistitem.h.

References _rd, and RouterDescriptor::name().

Referenced by operator<().

bool RouterListItem::operator< ( const QTreeWidgetItem &  other  )  const [virtual]

Overload the comparison operator.

Definition at line 109 of file routerlistitem.cpp.

References _country, _list, _statusValue, b(), RouterListWidget::CountryColumn, name(), RouterListWidget::NameColumn, and RouterListWidget::StatusColumn.

void RouterListItem::setLocation ( const GeoIp geoip  ) 

Sets the location information for this router item.

Definition at line 94 of file routerlistitem.cpp.

References _country, _rd, GeoIp::country(), COUNTRY_COLUMN, RouterDescriptor::setLocation(), and GeoIp::toLocation().

Referenced by NetViewer::resolved().

void RouterListItem::update ( const RouterDescriptor rd  ) 

Updates this router item using a new descriptor.

Definition at line 55 of file routerlistitem.cpp.

References _rd, _statusValue, RouterDescriptor::hibernating(), IMG_NODE_HIGH_BW, IMG_NODE_LOW_BW, IMG_NODE_MED_BW, IMG_NODE_NO_BW, IMG_NODE_OFFLINE, IMG_NODE_SLEEPING, RouterDescriptor::name(), NAME_COLUMN, RouterDescriptor::observedBandwidth(), RouterDescriptor::offline(), RouterDescriptor::platform(), and STATUS_COLUMN.

Referenced by RouterListWidget::addRouter(), and RouterListItem().


Member Data Documentation

QString RouterListItem::_country [private]

Country in which this router is likely located.

Definition at line 59 of file routerlistitem.h.

Referenced by operator<(), RouterListItem(), and setLocation().

RouterListWidget* RouterListItem::_list [private]

The list for this list item.

Definition at line 57 of file routerlistitem.h.

Referenced by operator<(), and RouterListItem().

RouterDescriptor* RouterListItem::_rd [private]

Descriptor for this router item.

Definition at line 56 of file routerlistitem.h.

Referenced by descriptor(), id(), name(), RouterListItem(), setLocation(), update(), and ~RouterListItem().

qint64 RouterListItem::_statusValue [private]

Value used to sort items by status.

Definition at line 58 of file routerlistitem.h.

Referenced by operator<(), and update().


The documentation for this class was generated from the following files:
Generated on Tue Jul 7 16:58:12 2009 for Vidalia by  doxygen 1.4.7