File name not exported correctly
The file name is not exported correctly via 'File→Export Parts' when using a period ('.') in the file name. Exporting a file 'Test Score No.2 - lorem ipsum.mscz' results in:
- Test Score No-Score_and_Parts.pdf
- Test Score No-Part1.pdf
- Test Score No-Part2.pdf
All characters after the period are cropped.
Comments
The code is in mscore/file.cpp, line 1693 and 1727. Looks like QFileInfo::baseName() doesn't work like we'd like it to work, check http://doc.qt.io/qt-5.4/qfileinfo.html#baseName, it says "The base name consists of all characters in the file up to (but not including) the first '.' character."
A possible fix would be to use QFileInfo::completeBaseName() instead, see http://doc.qt.io/qt-5.4/qfileinfo.html#completeBaseName, "The complete base name consists of all characters in the file up to (but not including) the last '.' character."
Which OS and MuseScore versions? I can reproduce this problem with MuseScore 2.0.2 on Windows XP. However, I can't reproduce it (i.e. works as expected) in MuseScore 2.0.2 on Ubuntu 15.10, so it seems this issue is OS-specific.
See https://github.com/musescore/MuseScore/pull/2316
As per the Qt documentation it should be OS independant. At least I don't see that my proposed change breaks it for other OSes
Well then, maybe I did something wrong but that's what happened when I tested this (it worked on Ubuntu, but not on Windows). Sorry, I don't have any more time to spend on this now though. I suggest you run a test for yourself.
For me, it does NOT work under Ubuntu 15.10 / MuseScore 2.1.0.
For me, it does NOT work under Kubuntu 15.10 / MuseScore 2.1.0. 600306e
Fixed in branch master, commit a862889de5
fix #90811: allow dots in filenames
rather than truncating and cutting off anything after the 1st dot of a
filename.
Fixed in branch master, commit 78b9fff803
Merge pull request #2316 from Jojo-Schmitz/basename
fix #90811: allow dots in filenames
Fixed in branch 2.0.3, commit e4c171eeda
fix #90811: allow dots in filenames
rather than truncating and cutting off anything after the 1st dot of a
filename.
Automatically closed -- issue fixed for 2 weeks with no activity.