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

Samplers, crates, playlists: fix storing import/export paths #4699

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Mar 17, 2022

Fixing a regression introduced by #4531 and #4539
on Windows the import/export path is not stored (affects import/export of sampler banks, crates and playlists)
https://bugs.launchpad.net/bugs/1964508

https://github.com/mixxxdj/mixxx/pull/4531/files#r829445200

I suspect this always truncates at position 0, see https://bugs.launchpad.net/bugs/1964508

Native separator is \ on Windows and maybe Qt has already converted the path to use /? In that case lastIndexOf("\") would return -1 which is equivalent to passing 0 to truncate
https://doc.qt.io/qt-5/qstring.html#truncate
It is not recommended to use QDir::separator() for constructing paths, but appearantly it also creates issues when computing paths
https://doc.qt.io/qt-5/qdir.html#separator

@ronso0 ronso0 marked this pull request as draft March 17, 2022 20:32
@ronso0
Copy link
Member Author

ronso0 commented Apr 9, 2022

Native separator is \ on Windows and maybe Qt has already converted the path to use /? In that case lastIndexOf("") would return -1 which is equivalent to passing 0 to truncate
https://doc.qt.io/qt-5/qstring.html#truncate
It is not recommended to use QDir::separator() for constructing paths, but appearantly it also creates issues when computing paths
https://doc.qt.io/qt-5/qdir.html#separator

Jep, confirmed on Win10
I'll prepare a fix

@ronso0 ronso0 added this to the 2.3.3 milestone Apr 10, 2022
@ronso0 ronso0 changed the title [Don't merge] debug storing Playlist/Crate import/export path Samplers, crates, playlists: fix storing import/export paths Apr 10, 2022
@ronso0 ronso0 marked this pull request as ready for review April 10, 2022 12:44
@daschuer daschuer added the changelog This PR should be included in the changelog label Apr 13, 2022
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you for digging it down remote.

@daschuer daschuer merged commit 5b6e2e0 into mixxxdj:2.3 Apr 13, 2022
@ronso0 ronso0 deleted the playlist-path-debug branch April 13, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This PR should be included in the changelog library minor bug regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants