mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Clear out listmodel row cache when swiching views
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user