Codechange: C++-ify the usage of IniFile in settings.cpp

Instead of creating the object on heap and use a pointer, create
the object on stack and use a guaranteed-not-null pointer.
The size of IniFile doesn't warrent the forcing to heap.

Additionally, use a subclass instead of a function to do some
initial bookkeeping on an IniFile meant to read a configuration.
This commit is contained in:
Patric Stout
2021-07-01 19:59:13 +02:00
committed by Patric Stout
parent a42251fc72
commit 66dc0ce196
3 changed files with 72 additions and 78 deletions

View File

@@ -24,8 +24,8 @@ void IConsoleListSettings(const char *prefilter);
void LoadFromConfig(bool minimal = false);
void SaveToConfig();
void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc);
void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc);
void IniLoadWindowSettings(IniFile &ini, const char *grpname, void *desc);
void IniSaveWindowSettings(IniFile &ini, const char *grpname, void *desc);
StringList GetGRFPresetList();
struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);