File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,7 @@ bool Score::saveFile()
385
385
temp.close ();
386
386
387
387
QString name (info.filePath ());
388
+ QDir dir (info.path ());
388
389
if (!saved ()) {
389
390
// if file was already saved in this session
390
391
// save but don't overwrite backup again
@@ -393,7 +394,6 @@ bool Score::saveFile()
393
394
// step 2
394
395
// remove old backup file if exists
395
396
//
396
- QDir dir (info.path ());
397
397
QString backupName = QString (" ." ) + info.fileName () + QString (" ," );
398
398
if (dir.exists (backupName)) {
399
399
if (!dir.remove (backupName)) {
@@ -421,6 +421,17 @@ bool Score::saveFile()
421
421
SetFileAttributes ((LPCTSTR)backupNativePath.toLocal8Bit (), FILE_ATTRIBUTE_HIDDEN);
422
422
#endif
423
423
}
424
+ else {
425
+ // file has previously been saved - remove the old file
426
+ if (dir.exists (name)) {
427
+ if (!dir.remove (name)) {
428
+ // if (!MScore::noGui)
429
+ // QMessageBox::critical(0, tr("MuseScore: Save File"),
430
+ // tr("Removing old file") + name + tr(" failed"));
431
+ }
432
+ }
433
+ }
434
+
424
435
//
425
436
// step 4
426
437
// rename temp name into file name
You can’t perform that action at this time.
0 commit comments