Vidalia
0.3.1
|
#include <RouterListItem.h>
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 GeoIpRecord &geoip) |
GeoIpRecord | location () const |
virtual bool | operator< (const QTreeWidgetItem &other) const |
Private Attributes | |
RouterDescriptor * | _rd |
RouterListWidget * | _list |
qint64 | _statusValue |
GeoIpRecord | _location |
QString | _countryCode |
Definition at line 30 of file RouterListItem.h.
RouterListItem::RouterListItem | ( | RouterListWidget * | list, |
RouterDescriptor | rd | ||
) |
Default constructor.
Definition at line 35 of file RouterListItem.cpp.
References _countryCode, _list, _rd, COUNTRY_COLUMN, IMG_FLAG_UNKNOWN, and update().
RouterListItem::~RouterListItem | ( | ) |
|
inline |
Returns the descriptor for this router.
Definition at line 47 of file RouterListItem.h.
References _rd.
Referenced by NetViewer::circuitSelected(), RouterListWidget::onSelectionChanged(), and NetViewer::retranslateUi().
|
inline |
Returns the router's ID.
Definition at line 43 of file RouterListItem.h.
References _rd, and RouterDescriptor::id().
Referenced by RouterListWidget::copySelectedFingerprints(), and RouterListWidget::zoomToSelectedRelay().
|
inline |
Returns the location information set for this router item.
Definition at line 51 of file RouterListItem.h.
References _location.
Referenced by NetViewer::addRouter(), and NetViewer::displayRouterInfo().
|
inline |
Returns the router's name.
Definition at line 45 of file RouterListItem.h.
References _rd, and RouterDescriptor::name().
Referenced by RouterListWidget::copySelectedNicknames(), and operator<().
|
virtual |
Overload the comparison operator.
Definition at line 110 of file RouterListItem.cpp.
References _countryCode, _list, _statusValue, b(), RouterListWidget::CountryColumn, name(), RouterListWidget::NameColumn, and RouterListWidget::StatusColumn.
void RouterListItem::setLocation | ( | const GeoIpRecord & | geoip | ) |
Sets the location information for this router item.
Sets the location information for this item's router descriptor.
Definition at line 95 of file RouterListItem.cpp.
References _countryCode, _rd, COUNTRY_COLUMN, GeoIpRecord::countryCode(), RouterDescriptor::setLocation(), and GeoIpRecord::toString().
Referenced by NetViewer::addRouter().
void RouterListItem::update | ( | const RouterDescriptor & | rd | ) |
Updates this router item using a new descriptor.
Updates the router descriptor for this item.
Definition at line 54 of file RouterListItem.cpp.
References _rd, _statusValue, RouterDescriptor::averageBandwidth(), RouterDescriptor::burstBandwidth(), 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().
|
private |
Definition at line 61 of file RouterListItem.h.
Referenced by operator<(), RouterListItem(), and setLocation().
|
private |
The list for this list item.
Definition at line 58 of file RouterListItem.h.
Referenced by operator<(), and RouterListItem().
|
private |
Location information for this router.
Definition at line 60 of file RouterListItem.h.
Referenced by location().
|
private |
Descriptor for this router item.
Definition at line 57 of file RouterListItem.h.
Referenced by descriptor(), id(), name(), RouterListItem(), setLocation(), update(), and ~RouterListItem().
|
private |
Value used to sort items by status.
Definition at line 59 of file RouterListItem.h.
Referenced by operator<(), and update().