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

Use Canonical Paths for Relative Paths Calculations #4211

merged 3 commits into from Mar 4, 2018


Copy link

@tresf tresf commented Mar 3, 2018

Forces strange paths like /path/.///to/../from/foo///// to be /path/from/foo.

Closes #4173

@@ -40,8 +40,10 @@ private slots:

QString absPath = fi.absoluteFilePath();
QString relPath = "drums/kick01.ogg";
QString fuzPath = absPath.replace(relPath, "drums/.///kick01.ogg");
Copy link

@PhysSong PhysSong Mar 4, 2018

Current one won't work because this line modifies absPath. This one will work:

QString fuzPath = absPath;
fuzPath.replace(relPath, "drums/.///kick01.ogg");

Copy link
Member Author

@tresf tresf Mar 4, 2018

Ah yes, forgot Strings are mutable in Qt. Thanks.

QString are mutable objects.  Call replace on the clone, not on the original.
@tresf tresf merged commit 1d63bd3 into LMMS:stable-1.2 Mar 4, 2018
1 check passed
@tresf tresf deleted the relative branch Mar 4, 2018
@tresf tresf restored the relative branch Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants