Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-12-09 23:11:16 +0000
committerStijn Buys <ingar@osirion.org>2012-12-09 23:11:16 +0000
commita70c15874a4a5eb9d96858ef8efd23018b476af1 (patch)
treeab9b391992137c2e305737f4927a68c3b47e80a3 /src
parent66fd5337bda32d0ef04fff7514a8249ecb5c3b15 (diff)
Remember previous selection when refreshing inventory listview.
Diffstat (limited to 'src')
-rw-r--r--src/client/inventorylistview.cc4
1 files changed, 2 insertions, 2 deletions
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) {