Fixed multi file ipc load speeds

This commit is contained in:
2026-02-26 02:44:22 -06:00
parent e9c0565c04
commit 6225915fda
6 changed files with 33 additions and 9 deletions
+4 -7
View File
@@ -26,12 +26,12 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerMixin)
self._setup_controller_data()
self._load_plugins_and_files(is_pre = True)
self._load_plugins(is_pre = True)
self._setup_styling()
self._setup_signals()
self._subscribe_to_events()
self._load_controllers()
self._load_plugins_and_files(is_pre = False)
self._load_plugins(is_pre = False)
logger.info(f"Made it past {self.__class__} loading...")
settings_manager.set_end_load_time()
@@ -60,13 +60,14 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerMixin)
def _subscribe_to_events(self):
event_system.subscribe("shutting-down", lambda: print("Shutting down..."))
event_system.subscribe("handle-file-from-ipc", self.handle_file_from_ipc)
event_system.subscribe("handle-files-from-ipc", self.handle_files_from_ipc)
event_system.subscribe("handle-dir-from-ipc", self.handle_dir_from_ipc)
event_system.subscribe("tggl-top-main-menubar", self._tggl_top_main_menubar)
def _load_controllers(self):
BridgeController()
def _load_plugins_and_files(self, is_pre: bool):
def _load_plugins(self, is_pre: bool):
args, unknownargs = settings_manager.get_starting_args()
if args.no_plugins == "true": return
@@ -78,9 +79,5 @@ class BaseController(IPCSignalsMixin, KeyboardSignalsMixin, BaseControllerMixin)
self.plugins_controller.post_launch_plugins()
return
def _load_files(self):
for file in settings_manager.get_starting_files():
event_system.emit("post-file-to-ipc", file)
def _tggl_top_main_menubar(self):
logger.debug("_tggl_top_main_menubar > stub...")
+5
View File
@@ -27,6 +27,7 @@ class CodeBase:
def _subscribe_to_events(self):
event_system.subscribe("handle-file", self._load_ipc_file)
event_system.subscribe("handle-files", self._load_ipc_files)
def _load_controllers(self):
files_controller = FilesController()
@@ -62,3 +63,7 @@ class CodeBase:
active_view = self.controller_manager["source_views"].signal_mapper.active_view
uris = [ f"file://{fpath}" ]
active_view._on_uri_data_received(uris)
def _load_ipc_files(self, uris: list):
active_view = self.controller_manager["source_views"].signal_mapper.active_view
active_view._on_uri_data_received(uris)
@@ -33,6 +33,7 @@ class SourceViewDnDMixin:
def _on_uri_data_received(self, uris: []):
uri = uris.pop(0)
self.command.exec_with_args("dnd_load_file_to_buffer", self, uri)
if not uris: return