Skip to content

Commit

Permalink
fix #12557 fix #21879
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jul 19, 2013
1 parent 770b64b commit eb4b94a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ bool MuseScore::checkDirty(Score* s)
QMessageBox::Save);
if (n == QMessageBox::Save) {
if (s->isSavable()) {
if (!s->saveFile())
if (!saveFile())
return true;
}
else {
Expand Down Expand Up @@ -335,10 +335,10 @@ Score* MuseScore::readScore(const QString& name)
// return true on success
//---------------------------------------------------------

void MuseScore::saveFile()
bool MuseScore::saveFile()
{
if (cs == 0)
return;
return false;
if (cs->created()) {
QString fn = cs->fileInfo()->fileName();
Text* t = cs->getText(TEXT_STYLE_TITLE);
Expand All @@ -364,7 +364,7 @@ void MuseScore::saveFile()
filter
);
if (fn.isEmpty())
return;
return false;
cs->fileInfo()->setFile(fn);

mscore->lastSaveDirectory = cs->fileInfo()->absolutePath();
Expand All @@ -375,7 +375,7 @@ void MuseScore::saveFile()
}
if (!cs->saveFile()) {
QMessageBox::critical(mscore, tr("MuseScore: Save File"), MScore::lastError);
return;
return false;
}
setWindowTitle("MuseScore: " + cs->name());
int idx = scoreList.indexOf(cs);
Expand All @@ -390,6 +390,7 @@ void MuseScore::saveFile()
cs->setTmpName("");
}
writeSessionFile(false);
return true;
}

//---------------------------------------------------------
Expand Down Expand Up @@ -1729,6 +1730,7 @@ Score::FileError readScore(Score* score, QString name, bool ignoreVersionError)
Score::FileError rv = score->loadMsc(name, ignoreVersionError);
if (rv != Score::FILE_NO_ERROR)
return rv;
score->setCreated(false);
}
else {
typedef Score::FileError (*ImportFunction)(Score*, const QString&);
Expand Down Expand Up @@ -1787,9 +1789,9 @@ Score::FileError readScore(Score* score, QString name, bool ignoreVersionError)
return Score::FILE_UNKNOWN_TYPE;
}
score->connectTies();
score->setCreated(true); // force save as for imported files
}
score->rebuildMidiMapping();
score->setCreated(false);
score->setSaved(false);

int staffIdx = 0;
Expand Down
2 changes: 1 addition & 1 deletion mscore/musescore.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
void editInstrList();
void symbolMenu();
void showKeyEditor();
void saveFile();
bool saveFile();
void fingeringMenu();
void registerPlugin(PluginDescription*);
int pluginIdxFromPath(QString pluginPath);
Expand Down

0 comments on commit eb4b94a

Please sign in to comment.