Album::loadScores() won't load a score that has a relative path
looking at the code for Album::loadScores(), I notice that there is logic to detect if a path is relative, and then stores the path in QString ip :
QString ip = item->path; if (ip[0] != '/') { // score path is relative to album path: QFileInfo f(_path); ip = f.path() + "/" + item->path; }
But then when actually performing the load, the code uses item->path
score->loadMsc(item->path, false);
It seems to me very clear that this is unintentional mistake...seems like the code should load using "ip" instead of item->path, because right now "ip" isn't even be used!
(Somewhere I remember someone mentioned a feature request to have album store paths relatively...I can't seem to find any metnion of that in the forums or issue tracker now. Maybe I should retitle this issue to also be a feature request to save album score paths relatively.)
Comments
See https://github.com/musescore/MuseScore/pull/2314
Thanks. Do you know what musescore.org user corresponds to this github user "Rechi"? Or was that a "drive-by" patch?
Also, if that PR is accepted, I would think should still clean up Album::loadScores() to remove these lines:
https://github.com/musescore/MuseScore/blob/master/mscore/album.cpp#L30…
since it looks like the full path is put in item->path during Album::load().
Same username on MuseScore.org, https://musescore.org/de/user/405711
of course! Seems like I already commented on that PR, that's why I remember! I added another comment https://github.com/musescore/MuseScore/pull/2314#issuecomment-190632384
Seems like that unintentiol error is in werner's intial github commit from 2012:
https://github.com/musescore/MuseScore/blob/412ca45401009faba19c1c1ab50…
I like to go fix that unintentionall error, and I can add corresponding .ui, but I'll wait untill I hear something back from Reichi or anyone.
Bump.
Even Rechi's PR is still mergable
That PR just got rebased for 2.2, as it no longer seems to apply to master
Relates to #292005: [EPIC] ALBUMS issues.