From a70c15874a4a5eb9d96858ef8efd23018b476af1 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 9 Dec 2012 23:11:16 +0000 Subject: Remember previous selection when refreshing inventory listview. --- src/client/inventorylistview.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/inventorylistview.cc b/src/client/inventorylistview.cc index b3dba61..49769ca 100644 --- a/src/client/inventorylistview.cc +++ b/src/client/inventorylistview.cc @@ -33,6 +33,8 @@ InventoryListView::~InventoryListView() void InventoryListView::set_inventory(core::Inventory *inventory, core::InfoType *infotype) { + const core::Item *selecteditem = (selected() ? selected()->item() : 0); + ListView::clear(); deselect(); @@ -46,7 +48,6 @@ void InventoryListView::set_inventory(core::Inventory *inventory, core::InfoType return; } - const core::Item *selecteditem = (selected() ? selected()->item() : 0); listview_timestamp = inventory->timestamp(); for (core::Inventory::Items::const_iterator it = inventory->items().begin(); it != inventory->items().end(); it++) { @@ -104,7 +105,6 @@ void InventoryListView::set_inventory(core::Inventory *inventory, core::InfoType sortkey.assign("-"); } - } else { if (item->amount() == 0) { -- cgit v1.2.3