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

Refactor loop to use QHash and ensure SimpleFileTreeModel destructor is called #13

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

Liderate
Copy link
Contributor

This factors out a loop that is costly when a directory contains many children. It also passes a parent to the model so the destructor is called when the preview dialog is closed.

@@ -159,7 +159,7 @@ QWidget* PreviewBsa::genBsaPreview(const QString& fileName, const QSize&)
layout->addWidget(infoLabel);

QTreeView* view = new QTreeView();
SimpleFileTreeModel* model = new SimpleFileTreeModel(m_Files);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the view to the model is kind of an anti-pattern, is that really necessary? What is something you tried for ownership?

@Holt59 Holt59 merged commit 79cdca3 into ModOrganizer2:master Oct 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants