Network: added ability to sort ServiceListItems correctly.

* Added ServiceListItem::Label() method.
This commit is contained in:
Axel Dörfler
2015-03-27 13:25:26 +01:00
parent 3d3eb8da69
commit 235571538b
2 changed files with 7 additions and 0 deletions
@@ -44,6 +44,7 @@
#include "InterfaceListItem.h"
#include "InterfaceView.h"
#include "ServiceListItem.h"
const char* kNetworkStatusSignature = "application/x-vnd.Haiku-NetworkStatus";
@@ -574,6 +575,10 @@ NetworkWindow::_ItemName(const BListItem* item)
const BNetworkInterfaceListItem*>(item))
return listItem->Label();
if (const ServiceListItem* listItem = dynamic_cast<
const ServiceListItem*>(item))
return listItem->Label();
if (const BStringItem* stringItem = dynamic_cast<const BStringItem*>(item))
return stringItem->Text();
@@ -25,6 +25,8 @@ public:
const BNetworkSettings& settings);
virtual ~ServiceListItem();
const char* Label() const { return fLabel; }
virtual void DrawItem(BView* owner,
BRect bounds, bool complete);
virtual void Update(BView* owner, const BFont* font);