Skip to content

Conversation

@JonathanFeenstra
Copy link
Contributor

Conflicts between hidden files are now no longer considered conflicts and will no longer show up in the mod conflict flags, the (advanced) conflicts tab, or the data tab if "Show conflicts only" is checked. The "Unhide" context menu action is also removed from the conflicts tab, since it's no longer used if hidden files no longer show up there.

Regarding the data tab filters, I considered force-unchecking and disabling the "Show hidden files" checkbox as soon as "Show conflicts only" filter is checked as an alternative implementation, but I think that will only lead to more complex code and worse UX since the user would have to re-check it again afterwards.

This was listed as a suggestion in #464.

Comment on lines 973 to 978
if (showConflictsOnly() &&
((file.getAlternatives().size() == 0) ||
fs::path(file.getName())
.extension()
.compare(ModInfo::s_HiddenExt.toStdWString()) == 0)) {
// only conflicts should be shown, but this file is hidden or not conflicted
Copy link
Member

Choose a reason for hiding this comment

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

This should be a hotpath, I don't know how fast the fs:path conversion to compare the extension is. Might be worth profiling this under a large setup. I know we got massive wins by using a faster string comparison in the past

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think file.getName().ends_with(ModInfo::s_HiddenExt.toStdWString()) would suffice? That's what I used here. I only used the fs::path conversion here to be consistent with similar existing code that I used as a reference.

Copy link
Member

Choose a reason for hiding this comment

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

The check needs to be case insensitive, which is what can make it costly. If it isn't a problem on a larger setup we don't need to optimize it. Just need to check it isn't a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The extension being anything other than fully lowercase would be an unusual edge case, but I suppose we should still account for that possibility. I'm not sure how to go about profiling it though. If we already know it's a hot path, I'd say it's worth optimizing regardless. How about boost::algorithm::iends_with(file.getName(), ModInfo::s_HiddenExt.toStdWString()))? It's case insensitive and doesn't require a fs::path conversion.

Copy link
Contributor

Choose a reason for hiding this comment

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

QString::fromStdWString(file.getName()).endsWith(ModInfo::s_HiddenExt, Qt::CaseInsensitive))

Not sure why FileEntry uses std::w/string types. Also the less boost usage, the better.

@qudix
Copy link
Contributor

qudix commented Feb 1, 2025

Any other considerations/blockers or can this be merged as is? I thought about having FileEntry use QString instead of std::wstring to avoid doing a bunch of conversions, but that would be for further optimization.

@JonathanFeenstra
Copy link
Contributor Author

Since I addressed the comments from you and AL, it can be merged as far as I'm concerned, unless another developer still wants to look at it. Changing FileEntry to use QString would be a pretty big refactor that probably deserves a separate PR.

@Holt59 Holt59 merged commit a823d2a into ModOrganizer2:master May 23, 2025
2 checks passed
@JonathanFeenstra JonathanFeenstra deleted the ignore-hidden-conflicts branch August 16, 2025 08:11
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.

4 participants