issues with exporting parts and part names containing slashes and/or dots

• Oct 28, 2014 - 09:04
Type
Functional
Severity
S4 - Minor
Status
closed
Project

There are some issues with generating the name of parts:

1. if the partname contains slashes ("/"), it gets truncated to everything after the (last) slash
2. if a partname contains dots ("."), it gets truncated to everything before the (last) dot (see also #22904: Anything after dot in part name doesn't appear)

So a part name of e.g. "5-str. Electric Bass" turns into a part's tab's title of "5-str", a part name of "Soprano/Alto" turns into "Alto".

the reason is that in mscore/scoretab.cpp, line 213 and also some other places in the same file the tab for the part gets added with something like

      tab2->addTab(excerpt->score()->name().replace("&","&&"));


Which in turn calls

      QString name() const           { return info.completeBaseName(); }


from libmscore/score.h. line 671 .
So the part name basically gets treated as a full "pathname/filename.extension" and only the "filename" part gets taken for the tab title.

Question is now whether to replace the / and by what and where, and whether to deal with the dot and where/how.
See also #33726: Partname doesn't get shown on the part if it consists of more than one instrument, where this has been discussed as a side issue.

One option would be to replace the slashes inside ExceptsDialog::createName(), in mscore/excerptsdialog.cpp

3. when actually exporting the parts, filenames are not sanitized in the same magger as they are for new scores created via the wizard, i.e. they can contain other special characters like :, [, umlauts, etc.
Fix would be quite easy: in mscore/file.cpp, line 1619 use "createDefaultFileName(pscore->name())", rather than just "pscore->name()2.
While at it, in line 1653 , we could make the suffix "Score_And_Parts" translatable, here again using "createDefaultFileName()", to be save from 'bogus' translations.

4. when actually exporting parts, but not having the main score tab selected, the front part of the filenames are derived from the part name rather than the score name.
Fix would be quite easy: in mscore/file.cpp, line 1593 use 2cs->parentScore()->name()" rather than cs->name() (with proper checking whether parentScore() exists, like "(cs->parentScore())?(cs->parentScore()->name()):(cs->name())").
Or is this intentional?

5. see #33726: Partname doesn't get shown on the part if it consists of more than one instrument, the field in the title frame of a part that should contain the partname is not filled when 'manually' creating a part that consists of more than one instrument, like e.g. a "Choir" part consisting the 2 staves of a SATB closed score plus piano. or a "Strings" part...


Comments

Title issues with exporting parts and part names containing slashed and/or dots issues with exporting parts and part names containing slashes and/or dots

I am not sure which thread to add this comment as there seem to be a bunch of related ones and my comment is a bit different, but FWIW:

At some point in the last few days on my Linux system, "Save As" started appending an *extra* ".mscz" to the filename (eg, "test.mscz.mscz"). Maybe not in all scores - maybe just for scores imported from 1.3, or My First Score? It seems to have fixed itself today, so nothing to worry about right now. But I just wanted to make sure people working on these sorts of issues are aware of this additional case to test for.