Skip to content

Commit

Permalink
Merge pull request #1426 from kmatheussen/preset_ext
Browse files Browse the repository at this point in the history
Automatically add an extension to the preset name if it has not been added manually
  • Loading branch information
kmatheussen authored Jan 14, 2024
2 parents db57fe0 + 486ab59 commit 87ab44e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions audio/Presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,17 @@ void PRESET_save(const vector_t *patches, bool save_button_pressed, int64_t pare
if(filename=="")
return;

QFileInfo fileInfo(filename);
QString extension = fileInfo.suffix();

if (is_multipreset) {
if (extension != "mrec")
filename += ".mrec";
} else {
if (extension != "rec")
filename += ".rec";
}

disk_t *file = DISK_open_for_writing(filename);

if(file==NULL){
Expand Down

0 comments on commit 87ab44e

Please sign in to comment.