Skip to content

Commit

Permalink
fix #150956: saving scores opened by relative pathname from cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos authored and lasconic committed Mar 15, 2018
1 parent 074d590 commit 28a54f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libmscore/scorefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ bool MasterScore::saveFile()
temp.close();

QString name(info.filePath());
QString basename(info.fileName());
QDir dir(info.path());
if (!saved()) {
// if file was already saved in this session
Expand All @@ -418,8 +419,8 @@ bool MasterScore::saveFile()
// step 3
// rename old file into backup
//
if (dir.exists(name)) {
if (!dir.rename(name, backupName)) {
if (dir.exists(basename)) {
if (!dir.rename(basename, backupName)) {
// if (!MScore::noGui)
// QMessageBox::critical(0, tr("Save File"),
// tr("Renaming old file <%1> to backup <%2> failed").arg(name, backupname);
Expand All @@ -433,8 +434,8 @@ bool MasterScore::saveFile()
}
else {
// file has previously been saved - remove the old file
if (dir.exists(name)) {
if (!dir.remove(name)) {
if (dir.exists(basename)) {
if (!dir.remove(basename)) {
// if (!MScore::noGui)
// QMessageBox::critical(0, tr("Save File"),
// tr("Removing old file %1 failed").arg(name));
Expand Down

0 comments on commit 28a54f3

Please sign in to comment.