Skip to content

Commit

Permalink
Orphanes data rows now get size in a thread
Browse files Browse the repository at this point in the history
  • Loading branch information
heliguy4599 committed Oct 4, 2023
1 parent c82ee4d commit a0cecb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/orphans_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ def onResponse(dialog, response_id, _function):
dialog.set_response_appearance("continue", Adw.ResponseAppearance.DESTRUCTIVE)
dialog.present()

def sizeThread(self, row, path):
row.set_subtitle(self.my_utils.getSizeWithFormat(path))

# Create the list of folders in the window
def generateList(self):

Expand All @@ -184,7 +187,9 @@ def generateList(self):

# Create row element
dir_row = Adw.ActionRow(title=dir_name)
dir_row.set_subtitle(self.my_utils.getSizeWithFormat(self.user_data_path + dir_name))
task = Gio.Task.new(None, None, None)
path = self.user_data_path + dir_name
task.run_in_thread(lambda _task, _obj, _data, _cancellable: self.sizeThread(dir_row, path))

select_button = Gtk.CheckButton()
select_button.add_css_class("selection-mode")
Expand Down

0 comments on commit a0cecb7

Please sign in to comment.