Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamer: Avoid listbox get_children #2564

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

danirabbit
Copy link
Member

There is no more ListBox.get_children () in GTK4

There's one place I didn't replace here and it's the block starting at line 154. I suppose we could iterate over the list and add to a counter to get the number of children? Alternatively if we switched this whole thing to use a ListModel we could get the number of items in the model, but we'd need to add a "new_name" property to Files.File. Thoughts @jeremypw?

@jeremypw
Copy link
Collaborator

I thought I had already rewritten this somewhere avoiding getting the number of children but I can't seem to locate it atm. If I can't find it I'll do it again.

@jeremypw
Copy link
Collaborator

As we only add rows in one place and never remove them, the simplest solution is to just count them as they are added. Using a model would be more elegant if rows are added and removed adhoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

2 participants