Clear out listmodel row cache when swiching views

This commit is contained in:
Daniel P. Berrange
2006-11-13 15:38:10 -05:00
parent c832682211
commit 70cf38da48

View File

@@ -223,6 +223,7 @@ class vmmManager(gobject.GObject):
vmlist = self.window.get_widget("vm-list")
model = vmlist.get_model()
model.clear()
self.rows = {}
uuids = self.connection.list_vm_uuids()
for vmuuid in uuids:
@@ -234,7 +235,7 @@ class vmmManager(gobject.GObject):
if not(self.is_showing_inactive()):
continue
self._append_vm(model, mv)
self._append_vm(model, vm)
def vm_added(self, connection, uri, vmuuid):
vm = self.connection.get_vm(vmuuid)
@@ -311,6 +312,9 @@ class vmmManager(gobject.GObject):
vmlist = self.window.get_widget("vm-list")
model = vmlist.get_model()
if not(self.rows.has_key(vm.get_uuid())):
return
row = self.rows[vm.get_uuid()]
# Handle, name, ID, status, status icon, cpu, cpu graph, vcpus, mem, mem bar
if vm.get_id() == -1: