Skip to content

Commit

Permalink
& character doesn't appear in tab or Open Recent
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jul 25, 2012
1 parent 12e92db commit ec5c613
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,8 +1358,9 @@ void MuseScore::openRecentMenu()
break;
// QFileInfo fi(s);
// QAction* action = openRecent->addAction(fi.completeBaseName());
QAction* action = openRecent->addAction(s); // show complete path
action->setData(s);
QString data(s);
QAction* action = openRecent->addAction(s.replace("&", "&&")); // show complete path
action->setData(data);
}
}

Expand Down
13 changes: 7 additions & 6 deletions mscore/scoretab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ void ScoreTab::setCurrent(int n)
QList<Excerpt*>& excerpts = score->excerpts();
if (!excerpts.isEmpty()) {
tab2->blockSignals(true);
tab2->addTab(score->name());
tab2->addTab(score->name().replace("&","&&"));
foreach(const Excerpt* excerpt, excerpts) {
tab2->addTab(excerpt->score()->name());
tab2->addTab(excerpt->score()->name().replace("&","&&"));
}
tab2->setCurrentIndex(tsv->part);
tab2->blockSignals(false);
Expand Down Expand Up @@ -228,9 +228,9 @@ void ScoreTab::updateExcerpts()
QList<Excerpt*>& excerpts = score->excerpts();
if (!excerpts.isEmpty()) {
tab2->blockSignals(true);
tab2->addTab(score->name());
tab2->addTab(score->name().replace("&","&&"));
foreach(const Excerpt* excerpt, excerpts)
tab2->addTab(excerpt->score()->name());
tab2->addTab(excerpt->score()->name().replace("&","&&"));
tab2->blockSignals(false);
tab2->setVisible(true);
}
Expand Down Expand Up @@ -282,7 +282,7 @@ void ScoreTab::insertTab(Score* s)
{
int idx = scoreList->indexOf(s);
tab->blockSignals(true);
tab->insertTab(idx, s->name());
tab->insertTab(idx, s->name().replace("&","&&"));
tab->setTabData(idx, QVariant::fromValue<void*>(new TabScoreView(s)));
tab->blockSignals(false);
}
Expand All @@ -293,7 +293,8 @@ void ScoreTab::insertTab(Score* s)

void ScoreTab::setTabText(int idx, const QString& s)
{
tab->setTabText(idx, s);
QString text(s);
tab->setTabText(idx, text.replace("&","&&"));
}

//---------------------------------------------------------
Expand Down

0 comments on commit ec5c613

Please sign in to comment.