Limiting thread spawns

This commit is contained in:
2023-01-07 14:15:06 -06:00
parent 95076afb6a
commit 81a88a73db
6 changed files with 97 additions and 2 deletions

View File

@@ -31,14 +31,18 @@ class GridMixin:
for file in files:
store.append([None, file[0]])
for i, file in enumerate(files):
self.create_icon(i, tab, store, dir, file[0])
self.load_icons(tab, store, dir, files)
# NOTE: Not likely called often from here but it could be useful
if save_state and not trace_debug:
self.fm_controller.save_state()
@threaded
def load_icons(self, tab, store, dir, files):
for i, file in enumerate(files):
self.create_icon(i, tab, store, dir, file[0])
def create_icon(self, i, tab, store, dir, file):
icon = tab.create_icon(dir, file)
GLib.idle_add(self.update_store, *(i, store, icon, tab, dir, file,))