Skip to content

Fix issue #122#123

Merged
chryswoods merged 2 commits intodevelfrom
fix_122
Nov 7, 2023
Merged

Fix issue #122#123
chryswoods merged 2 commits intodevelfrom
fix_122

Conversation

@lohedges
Copy link
Copy Markdown
Contributor

@lohedges lohedges commented Nov 7, 2023

This PR closes #122 by fixing the use of QString::compare when comparing molecular properties. We added a new (as yet unused) is_non_searchable_water property to allow a user to preserve water topologies, e.g. by excluding them from a search. However, I don't want to keep this property when swapping topology, so don't copy it to the new water template. I was incorrectly using QString::compare since I hadn't realised that it returned an int, not a bool. The return value is zero only when the strings match.

This will be tested via BioSimSpace.

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the GPL3 license: [y]

Suggested reviewers:

@chryswoods

Copy link
Copy Markdown
Contributor

@chryswoods chryswoods left a comment

Choose a reason for hiding this comment

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

That is a surprising API - I would have expected compare to return a bool too.

@chryswoods chryswoods merged commit 4a1025e into devel Nov 7, 2023
@chryswoods chryswoods deleted the fix_122 branch November 7, 2023 18:04
@xiki-tempula
Copy link
Copy Markdown

@chryswoods Do you mind back port this into the main as well, please? Thank you.

@chryswoods
Copy link
Copy Markdown
Contributor

Yes - although I will delegate ;-)

@lohedges - do you have time to do this tomorrow? I'm at a meeting in London all day.

@lohedges
Copy link
Copy Markdown
Contributor Author

lohedges commented Nov 8, 2023

Yes, no problem.

@chryswoods
Copy link
Copy Markdown
Contributor

Thanks :-)

lohedges added a commit that referenced this pull request Nov 9, 2023
lohedges added a commit that referenced this pull request Nov 9, 2023
@lohedges
Copy link
Copy Markdown
Contributor Author

lohedges commented Nov 9, 2023

This is now backported into main.

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.

[BUG] Invalid use of QString::compare when swapping water topology

3 participants