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

Fixes #701 drag and drop is broken #702

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

mikfire
Copy link
Contributor

@mikfire mikfire commented Dec 30, 2022

The logic in BtTreeView::mimeData was broken. As we always set itsa, the std::optional variable would have never been false. This resulted in setting the mime type to application/x-brewtarget-folder for anything that wasn't a Recipe, Style or Folder. Since the tables are configured to only accept application/x-brewtarget-ingredient, they wouldn't accept the drop.

To fix it, I changed all the tests around. We test for Recipe, Style and Equipment; then we test for Folder; then we test to not be Water. That sets all of the mime types correct. I also added an application/x-brewtarget-water in case I ever want to get clever.

The login in BtTreeView::mimeData was broken. As we always set itsa, the
std::optional variable would have never been false. This resulted in
setting the mime type to `application/x-brewtarget-folder` for anything
that wasn't a Recipe, Style or Folder. Since the tables are configured
to only accept `application/x-brewtarget-ingredient`, they wouldn't
accept the drop.

To fix it, I changed all the tests around. We test for Recipe, Style and
Equipment; then we test for Folder; then we test to not be Water. That
sets all of the mime types correct. I also added an
`application/x-brewtarget-water` in case I ever want to get clever.
@matty0ung matty0ung merged commit 40fc2af into Brewtarget:develop Dec 31, 2022
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