View Issue Details

IDProjectCategoryView StatusLast Update
0000762OpenMPTGeneralpublic2016-03-28 21:51
Reporterchris82 Assigned ToSaga Musix  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionOpenMPT 1.25.04.00 / libopenmpt 0.2-beta16 (upgrade first) 
Target VersionOpenMPT 1.26.01.00 / libopenmpt 0.2-beta17 (upgrade first)Fixed in VersionOpenMPT 1.26.01.00 / libopenmpt 0.2-beta17 (upgrade first) 
Summary0000762: Allow saving without changing extension
Description

When you try to save a module which doesn't have the proper extension, openMpt add the extension at the end.
This is not a good behaviour as there was probably a reason if the file had that extension to begin.

The patch attached affect only "save", and not "save as" so it doesn't break anything.

TagsNo tags attached.
Attached Files
commit-05bf75e.diff (614 bytes)   
commit 05bf75e4ea13500b877f5652f0b2a0d0d94c5adc
Author: 00christian00 <00christian00@users.noreply.github.com>
Date:   Mon Mar 21 09:48:17 2016 +0100

    Allow saving with the original name, without appending the .IT extension!

diff --git a/mptrack/Moddoc.cpp b/mptrack/Moddoc.cpp
index 4bac43a..3b79939 100644
--- a/mptrack/Moddoc.cpp
+++ b/mptrack/Moddoc.cpp
@@ -625,7 +625,7 @@ BOOL CModDoc::DoSave(const mpt::PathString &filename, BOOL)
 		saveFileName = dlg.GetFirstFile();
 	} else
 	{
-		saveFileName = filename.ReplaceExt(ext);
+		saveFileName = filename;
 	}
 
 	// Do we need to create a backup file ?
commit-05bf75e.diff (614 bytes)   
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2016-03-23 19:52

administrator   ~0002297

There is actually a good reason for the current behaviour - Namely saving files that were imported from formats that OpenMPT cannot save. For example, assuming that you load sometune.j2b and hit Ctrl+S, it really should be resaved as sometune.it and not sometune.j2b. What kind of usage scenario do you envision for your patch?

chris82

chris82

2016-03-23 20:02

reporter   ~0002299

In my case I need to rename the modules as .bytes, as if I leave them as IT they are recognized as audio files by Unity3d and I can't parse them as binary with my library and unity internal module player is too limited and buggy.

Maybe an option in the advanced settings then?

Saga Musix

Saga Musix

2016-03-23 20:05

administrator   ~0002300

Hm, I think to have the best of both worlds, I could take your patch and then set m_ShowSavedialog = true for all files that would need to be re-saved in a different format.

chris82

chris82

2016-03-23 20:18

reporter   ~0002304

Sounds good

Saga Musix

Saga Musix

2016-03-28 21:51

administrator   ~0002313

Behaviour was changed in r6178.

Issue History

Date Modified Username Field Change
2016-03-23 19:47 chris82 New Issue
2016-03-23 19:47 chris82 File Added: commit-05bf75e.diff
2016-03-23 19:52 Saga Musix Note Added: 0002297
2016-03-23 20:02 chris82 Note Added: 0002299
2016-03-23 20:05 Saga Musix Note Added: 0002300
2016-03-23 20:18 chris82 Note Added: 0002304
2016-03-23 20:44 Saga Musix Assigned To => Saga Musix
2016-03-23 20:44 Saga Musix Status new => assigned
2016-03-28 21:51 Saga Musix Note Added: 0002313
2016-03-28 21:51 Saga Musix Status assigned => resolved
2016-03-28 21:51 Saga Musix Resolution open => fixed
2016-03-28 21:51 Saga Musix Fixed in Version => OpenMPT 1.26.01.00 / libopenmpt 0.2-beta17 (upgrade first)
2016-03-28 21:51 Saga Musix Target Version => OpenMPT 1.26.01.00 / libopenmpt 0.2-beta17 (upgrade first)