From baf6ad1f48ef08187f50247115c09a3612ebeec3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 8 Nov 2010 23:33:49 +0000 Subject: added sorting of listview items --- src/client/inventorylistview.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/client/inventorylistview.h') diff --git a/src/client/inventorylistview.h b/src/client/inventorylistview.h index 1688560..b937e0e 100644 --- a/src/client/inventorylistview.h +++ b/src/client/inventorylistview.h @@ -13,7 +13,10 @@ namespace client { - + +/** + * @brief a listview displaying the items in an inventory belonging to a specified infotype + */ class InventoryListView : public ui::ListView { public: InventoryListView(ui::Widget *parent = 0); @@ -21,6 +24,15 @@ public: void set_inventory(core::Inventory *inventory, core::InfoType *infotype); + /** + * @brief enable or disable the listing of empty items + * Items are empty if their amount is 0 + */ + inline void set_showempty(const bool showempty) + { + listview_showempty = showempty; + } + inline const core::Inventory *inventory() const { return listview_inventory; } @@ -34,6 +46,7 @@ private: unsigned long listview_timestamp; unsigned long listview_infotimestamp; + bool listview_showempty; core::Inventory *listview_inventory; core::InfoType *listview_infotype; }; -- cgit v1.2.3