Skip to content

Commit 5c83ab4

Browse files
authored
Merge pull request #29380 from miiizen/29328-duplicate-jumps
Fix duplicate "To coda (symbol)" items in palette
2 parents 21130bb + 48e8067 commit 5c83ab4

31 files changed

+110
-78
lines changed

src/engraving/dom/property.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static constexpr PropertyMetaData propertyList[] = {
206206
{ Pid::PLAY_UNTIL, true, "playUntil", P_TYPE::STRING, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "play until") },
207207
{ Pid::CONTINUE_AT, true, "continueAt", P_TYPE::STRING, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "continue at") },
208208
{ Pid::LABEL, true, "label", P_TYPE::STRING, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "label") },
209-
{ Pid::MARKER_TYPE, true, "markerType", P_TYPE::INT, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "marker type") },
209+
{ Pid::MARKER_TYPE, true, "markerType", P_TYPE::MARKER_TYPE, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "marker type") },
210210
{ Pid::MARKER_SYMBOL_SIZE, true, "markerSymbolSize", P_TYPE::REAL, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "marker symbol size") },
211211
{ Pid::MARKER_CENTER_ON_SYMBOL, true, "markerCenterOnSymbol", P_TYPE::BOOL, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "marker center on symbol") },
212212
{ Pid::ARP_USER_LEN1, false, "arpUserLen1", P_TYPE::REAL, PropertyGroup::APPEARANCE, DUMMY_QT_TR_NOOP("propertyName", "length 1") },

src/engraving/rw/read410/tread.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ PropertyValue TRead::readPropertyValue(Pid id, XmlReader& e, ReadContext& ctx)
446446
return PropertyValue(TConv::fromXml(e.readAsciiText(), AutoOnOff::AUTO));
447447
case P_TYPE::PARTIAL_SPANNER_DIRECTION:
448448
return PropertyValue(TConv::fromXml(e.readAsciiText(), PartialSpannerDirection::OUTGOING));
449+
case P_TYPE::MARKER_TYPE:
450+
return PropertyValue(TConv::fromXml(e.readAsciiText(), MarkerType::USER));
449451
default:
450452
ASSERT_X("unhandled PID type");
451453
break;

src/engraving/rw/read460/tread.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ PropertyValue TRead::readPropertyValue(Pid id, XmlReader& e, ReadContext& ctx)
460460
return PropertyValue(TConv::fromXml(e.readAsciiText(), ParenthesesMode::NONE));
461461
case P_TYPE::AUTO_CUSTOM_HIDE:
462462
return PropertyValue(TConv::fromXml(e.readAsciiText(), AutoCustomHide::AUTO));
463+
case P_TYPE::MARKER_TYPE:
464+
return PropertyValue(TConv::fromXml(e.readAsciiText(), MarkerType::USER));
463465
default:
464466
ASSERT_X("unhandled PID type");
465467
break;
@@ -1697,21 +1699,18 @@ void TRead::read(Accidental* a, XmlReader& e, ReadContext& ctx)
16971699

16981700
void TRead::read(Marker* m, XmlReader& e, ReadContext& ctx)
16991701
{
1700-
MarkerType mt = MarkerType::SEGNO;
1701-
17021702
while (e.readNextStartElement()) {
17031703
const AsciiStringView tag(e.name());
17041704
if (tag == "label") {
17051705
AsciiStringView s(e.readAsciiText());
17061706
m->setLabel(String::fromAscii(s.ascii()));
1707-
mt = TConv::fromXml(s, MarkerType::USER);
1707+
} else if (readProperty(m, tag, e, ctx, Pid::MARKER_TYPE)) {
17081708
} else if (readProperty(m, tag, e, ctx, Pid::MARKER_CENTER_ON_SYMBOL)) {
17091709
} else if (readProperty(m, tag, e, ctx, Pid::MARKER_SYMBOL_SIZE)) {
17101710
} else if (!readProperties(static_cast<TextBase*>(m), e, ctx)) {
17111711
e.unknown();
17121712
}
17131713
}
1714-
m->setMarkerType(mt);
17151714
}
17161715

17171716
void TRead::read(Jump* j, XmlReader& e, ReadContext& ctx)

src/engraving/rw/write/twrite.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,7 @@ void TWrite::write(const Marker* item, XmlWriter& xml, WriteContext& ctx)
23002300
xml.startElement(item);
23012301
writeProperties(static_cast<const TextBase*>(item), xml, ctx, true);
23022302
xml.tag("label", item->label());
2303+
writeProperty(item, xml, Pid::MARKER_TYPE);
23032304
writeProperty(item, xml, Pid::MARKER_CENTER_ON_SYMBOL);
23042305
writeProperty(item, xml, Pid::MARKER_SYMBOL_SIZE);
23052306
xml.endElement();

src/engraving/rw/xmlwriter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ void XmlWriter::tagProperty(const AsciiStringView& name, P_TYPE type, const Prop
316316
case P_TYPE::PARENTHESES_MODE: {
317317
element(name, TConv::toXml(data.value<ParenthesesMode>()));
318318
} break;
319+
case P_TYPE::MARKER_TYPE: {
320+
element(name, TConv::toXml(data.value<MarkerType>()));
321+
} break;
319322
default: {
320323
UNREACHABLE; //! TODO
321324
}

src/engraving/tests/compat114_data/markers-ref.mscx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<style>repeat_left</style>
8282
<text><sym>segno</sym></text>
8383
<label>segno</label>
84+
<markerType>segno</markerType>
8485
</Marker>
8586
<voice>
8687
<Clef>
@@ -112,6 +113,7 @@
112113
<style>repeat_left</style>
113114
<text><sym>coda</sym></text>
114115
<label>codab</label>
116+
<markerType>codab</markerType>
115117
</Marker>
116118
<voice>
117119
<Rest>
@@ -128,6 +130,7 @@
128130
<style>repeat_left</style>
129131
<text><sym>codaSquare</sym></text>
130132
<label>varcoda</label>
133+
<markerType>varcoda</markerType>
131134
</Marker>
132135
<voice>
133136
<Rest>
@@ -148,6 +151,7 @@
148151
<style>repeat_left</style>
149152
<text><sym>coda</sym><sym>coda</sym></text>
150153
<label>codetta</label>
154+
<markerType>codetta</markerType>
151155
</Marker>
152156
<voice>
153157
<Rest>
@@ -292,6 +296,7 @@
292296
<style>repeat_right</style>
293297
<text>To Coda</text>
294298
<label>coda</label>
299+
<markerType>coda</markerType>
295300
</Marker>
296301
<voice>
297302
<Rest>

src/engraving/tests/compat206_data/markers-ref.mscx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<style>repeat_left</style>
8080
<text><sym>segno</sym></text>
8181
<label>segno</label>
82+
<markerType>segno</markerType>
8283
</Marker>
8384
<voice>
8485
<TimeSig>
@@ -100,6 +101,7 @@
100101
<style>repeat_left</style>
101102
<text><sym>segnoSerpent1</sym></text>
102103
<label>varsegno</label>
104+
<markerType>varsegno</markerType>
103105
</Marker>
104106
<voice>
105107
<Rest>
@@ -116,6 +118,7 @@
116118
<style>repeat_left</style>
117119
<text><sym>coda</sym></text>
118120
<label>codab</label>
121+
<markerType>codab</markerType>
119122
</Marker>
120123
<voice>
121124
<Rest>
@@ -136,6 +139,7 @@
136139
<style>repeat_left</style>
137140
<text><sym>codaSquare</sym></text>
138141
<label>varcoda</label>
142+
<markerType>varcoda</markerType>
139143
</Marker>
140144
<voice>
141145
<Rest>
@@ -168,6 +172,7 @@
168172
<style>repeat_right</style>
169173
<text>To Coda</text>
170174
<label>coda</label>
175+
<markerType>coda</markerType>
171176
</Marker>
172177
<voice>
173178
<Rest>

src/engraving/tests/partialtie_data/coda-ref.mscx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
<style>repeat_right</style>
122122
<text>To Coda</text>
123123
<label>coda</label>
124+
<markerType>coda</markerType>
124125
</Marker>
125126
<LayoutBreak>
126127
<eid>J_J</eid>
@@ -234,6 +235,7 @@
234235
<style>repeat_left</style>
235236
<text><sym>coda</sym></text>
236237
<label>codab</label>
238+
<markerType>codab</markerType>
237239
</Marker>
238240
<voice>
239241
<Chord>

src/engraving/tests/partialtie_data/volta_coda-ref.mscx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
<style>repeat_right</style>
103103
<text>To Coda</text>
104104
<label>coda</label>
105+
<markerType>coda</markerType>
105106
</Marker>
106107
<LayoutBreak>
107108
<eid>F_F</eid>
@@ -304,6 +305,7 @@
304305
<style>repeat_left</style>
305306
<text><sym>coda</sym></text>
306307
<label>codab</label>
308+
<markerType>codab</markerType>
307309
</Marker>
308310
<voice>
309311
<Spanner type="Volta">

src/engraving/tests/utils/scorecomp.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ bool ScoreComp::saveCompareScore(Score* score, const String& saveName, const Str
3737
}
3838
bool val = compareFiles(ScoreRW::rootPath() + u"/" + compareWithLocalPath, saveName);
3939

40-
if (!val) {
41-
copyFile(saveName, ScoreRW::rootPath() + u"/" + compareWithLocalPath);
42-
return false;
43-
}
44-
4540
return val;
4641
}
4742

@@ -54,33 +49,6 @@ bool ScoreComp::saveCompareMimeData(muse::ByteArray mimeData, const muse::String
5449
return compareFiles(ScoreRW::rootPath() + u"/" + compareWithLocalPath, saveName);
5550
}
5651

57-
bool ScoreComp::copyFile(const String& fullPath1, const String& fullPath2)
58-
{
59-
QString cmd = "cp";
60-
QStringList args;
61-
args.append(fullPath1);
62-
args.append(fullPath2);
63-
64-
QProcess p;
65-
p.start(cmd, args);
66-
if (!p.waitForFinished()) {
67-
QTextStream outputText(stdout);
68-
outputText << "copy failed finished";
69-
return false;
70-
}
71-
72-
int code = p.exitCode();
73-
if (code) {
74-
QByteArray ba = p.readAll();
75-
QTextStream outputText(stdout);
76-
outputText << String(ba);
77-
outputText << String(" <cp %1 %2 failed, code: %3 \n").arg(fullPath1, fullPath2).arg(code);
78-
return false;
79-
}
80-
LOGD() << "Copy succeeded: " << String(" <cp %1 %2>\n").arg(fullPath1, fullPath2).arg(code);
81-
return true;
82-
}
83-
8452
bool ScoreComp::compareFiles(const String& fullPath1, const String& fullPath2)
8553
{
8654
QString cmd = "diff";

0 commit comments

Comments
 (0)