clan_vm_manager: Cache profiler obj for multi call functions

This commit is contained in:
Qubasa
2024-03-04 15:52:49 +07:00
parent b2d3ff4431
commit b77ffac4d4
5 changed files with 92 additions and 39 deletions

View File

@@ -7,6 +7,7 @@ from clan_cli.history.add import HistoryEntry
from clan_vm_manager import assets
from clan_vm_manager.components.gkvstore import GKVStore
from clan_vm_manager.components.profiler import profile
from clan_vm_manager.components.vmobj import VMObject
gi.require_version("GObject", "2.0")
@@ -47,6 +48,7 @@ class ClanStore:
self.push_history_entry(vm)
return GLib.SOURCE_REMOVE
@profile
def push_history_entry(self, entry: HistoryEntry) -> None:
# TODO: We shouldn't do this here but in the list view
if entry.flake.icon is None: