/eMule/CreateSparseFiles is a functional, EC-wired preference that has no control in either amule or amuleGUI. Users can only change it by hand-editing amule.conf. The amuleapi Web UI already exposes it as files.create_normal; the desktop should offer the same checkbox.
Current state
- The pref is registered as INI-only:
Preferences.cpp:1674 pushes it onto s_MiscList instead of binding it to a widget with NewCfgItem(<IDC_*>, …) the way AllocateFullFile does at Preferences.cpp:1378.
- No
IDC_* id exists, no checkbox in muuli_wdr.{h,cpp}, no handling in PrefsUnifiedDlg.cpp, and no translatable _() string — so it is absent from the message catalogs too.
- amuleGUI shares
PrefsUnifiedDlg, so it is missing in remote mode as well.
Why it matters
The setting has a real effect on how part files are created (PartFile.cpp:360-378) and it is not covered by the existing "Preallocate disk space for new files" checkbox. The three combinations behave differently:
CreateSparseFiles |
AllocateFullFile |
Behaviour |
true (default) |
false |
sparse file of the full size, no real blocks committed |
false |
false |
plain empty file that grows as data arrives |
| — |
true |
plain file plus a full CAllocateFileTask preallocation |
Turning sparse files off matters on filesystems where sparse allocation is unsupported, slow, or interacts badly with backup/dedup tooling, and it makes free-space accounting honest while a download is in progress.
Proposed change
Add a checkbox on the Files preferences page, next to "Preallocate disk space for new files" (muuli_wdr.cpp:1593), bound the same way:
- new id in
muuli_wdr.h (e.g. IDC_CREATEFILESSPARSE)
wxCheckBox in the Files page in muuli_wdr.cpp, with a tooltip
- move the pref in
Preferences.cpp:1674 from s_MiscList.push_back(...) to NewCfgItem(IDC_CREATEFILESSPARSE, new Cfg_Bool("/eMule/CreateSparseFiles", s_createFilesSparse, true))
No EC work is required: the tag is already serialized (ECSpecialMuleTags.cpp:352), applied (:766), and EC_PREFS_FILES is already in amuleGUI's exchange mask (amule-remote-gui.cpp:1152), so the control round-trips in remote mode for free.
Note the sense: the stored key is sparse (true by default), while the accessor used by EC is the inverted CreateFilesNormal() (Preferences.h:636). Whichever polarity the label uses, it must match the widget binding.
Prior art — the Web UI already ships this
The amuleapi Web UI exposes the same pref as files.create_normal on the Files tab, in the Downloads group, immediately after alloc_full_size (src/webapi/static/js/views/preferences.js:129):
{ key: "endgame", type: "bool" },
{ key: "alloc_full_size", type: "bool" },
{ key: "create_normal", type: "bool" }, // <-- here
{ key: "check_free_space", type: "bool" },
with the labels (src/webapi/static/i18n/en.json:662, es.json:662):
"prefs_field_files_create_normal": "Create new files non-sparse (allocate real disk blocks)"
"prefs_field_files_create_normal": "Crear los archivos nuevos sin huecos (reservar bloques reales en disco)"
The Web UI uses the positive create_normal sense (true = non-sparse) because that is what the API and the EC tag carry.
Acceptance criteria
/eMule/CreateSparseFilesis a functional, EC-wired preference that has no control in either amule or amuleGUI. Users can only change it by hand-editingamule.conf. The amuleapi Web UI already exposes it asfiles.create_normal; the desktop should offer the same checkbox.Current state
Preferences.cpp:1674pushes it ontos_MiscListinstead of binding it to a widget withNewCfgItem(<IDC_*>, …)the wayAllocateFullFiledoes atPreferences.cpp:1378.IDC_*id exists, no checkbox inmuuli_wdr.{h,cpp}, no handling inPrefsUnifiedDlg.cpp, and no translatable_()string — so it is absent from the message catalogs too.PrefsUnifiedDlg, so it is missing in remote mode as well.Why it matters
The setting has a real effect on how part files are created (
PartFile.cpp:360-378) and it is not covered by the existing "Preallocate disk space for new files" checkbox. The three combinations behave differently:CreateSparseFilesAllocateFullFiletrue(default)falsefalsefalsetrueCAllocateFileTaskpreallocationTurning sparse files off matters on filesystems where sparse allocation is unsupported, slow, or interacts badly with backup/dedup tooling, and it makes free-space accounting honest while a download is in progress.
Proposed change
Add a checkbox on the Files preferences page, next to "Preallocate disk space for new files" (
muuli_wdr.cpp:1593), bound the same way:muuli_wdr.h(e.g.IDC_CREATEFILESSPARSE)wxCheckBoxin the Files page inmuuli_wdr.cpp, with a tooltipPreferences.cpp:1674froms_MiscList.push_back(...)toNewCfgItem(IDC_CREATEFILESSPARSE, new Cfg_Bool("/eMule/CreateSparseFiles", s_createFilesSparse, true))No EC work is required: the tag is already serialized (
ECSpecialMuleTags.cpp:352), applied (:766), andEC_PREFS_FILESis already in amuleGUI's exchange mask (amule-remote-gui.cpp:1152), so the control round-trips in remote mode for free.Note the sense: the stored key is sparse (
trueby default), while the accessor used by EC is the invertedCreateFilesNormal()(Preferences.h:636). Whichever polarity the label uses, it must match the widget binding.Prior art — the Web UI already ships this
The amuleapi Web UI exposes the same pref as
files.create_normalon the Files tab, in the Downloads group, immediately afteralloc_full_size(src/webapi/static/js/views/preferences.js:129):with the labels (
src/webapi/static/i18n/en.json:662,es.json:662):The Web UI uses the positive
create_normalsense (true= non-sparse) because that is what the API and the EC tag carry.Acceptance criteria
/eMule/CreateSparseFilesinamule.confwith the inverted value._()and appear inpo/amule.pot.