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

Don't auto-install recommendations when auditing recommendations #2606

Merged
merged 2 commits into from
Dec 12, 2018

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Dec 8, 2018

Problem

If you use the File ⇒ Audit recommendations option from #2577 to select one or more mods to install, those mods' recommendations will also be installed regardless of whether you selected them.

Cause

RelationshipResolver takes a RelationshipResolverOptions parameter that specifies what to do with recommendations and suggestions, among other things. Since it can be inconvenient to set 7 boolean member variables individually, a RelationshipResolver.DefaultOpts() function returns a default set of options.

This DefaultOpts() object was used for Audit recommendations. Unfortunately that object sets with_recommends to true, so this causes all recommendations of the specified mods to be treated as hard dependencies, which doesn't make sense to do in GUI. It's kind of awkward to have a "default" object that you never want to use as-is.

Changes

Now DefaultOpts has a companion function called DependsOnlyOpts, which doesn't pull in recommendations. This is now used in five places which previously had this behavior, including normal installation and the Audit recommendations flow.

Also, the Audit recommendations menu item is now disabled if you have a change set. This is to prevent confusion about what should happen in such situations.

image

Fixes #2604.

@HebaruSan HebaruSan added Bug GUI Issues affecting the interactive GUI Pull request Relationships Issues affecting depends, recommends, etc. labels Dec 8, 2018
@politas politas merged commit 7208a28 into KSP-CKAN:master Dec 12, 2018
politas added a commit that referenced this pull request Dec 12, 2018
@HebaruSan HebaruSan deleted the fix/audit-rec-opts branch December 12, 2018 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Issues affecting the interactive GUI Pull request Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants