1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Demote Get/SetVersionKeysInit from AudacityPrefs into FileConfig

This commit is contained in:
Paul Licameli
2021-01-31 09:36:41 -05:00
parent 05d5f2677c
commit 030ba78c5f
2 changed files with 23 additions and 24 deletions

View File

@@ -50,9 +50,7 @@ extern AUDACITY_DLL_API AudacityPrefs *gPrefs;
extern int gMenusDirty;
/// \brief Our own specialisation of wxFileConfig. It is essentially a renaming,
/// though it does provide one new access function. Most of the prefs work
/// is actually done by the InitPreferences() function.
/// \brief Our own specialisation of wxFileConfig. It is essentially a renaming.
class AUDACITY_DLL_API AudacityPrefs : public FileConfig
{
public:
@@ -62,26 +60,6 @@ public:
const wxString& globalFilename = {},
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
const wxMBConv& conv = wxConvAuto());
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
void SetVersionKeysInit( int major, int minor, int micro)
{
mVersionMajorKeyInit = major;
mVersionMinorKeyInit = minor;
mVersionMicroKeyInit = micro;
}
void GetVersionKeysInit( int& major, int& minor, int& micro) const
{
major = mVersionMajorKeyInit;
minor = mVersionMinorKeyInit;
micro = mVersionMicroKeyInit;
}
// values of the version major/minor/micro keys in audacity.cfg
// when Audacity first opens
int mVersionMajorKeyInit{};
int mVersionMinorKeyInit{};
int mVersionMicroKeyInit{};
};
struct ByColumns_t{};

View File

@@ -29,6 +29,20 @@ public:
virtual bool Flush(bool bCurrentOnly = false) wxOVERRIDE;
// Set and Get values of the version major/minor/micro keys in audacity.cfg when Audacity first opens
void SetVersionKeysInit( int major, int minor, int micro)
{
mVersionMajorKeyInit = major;
mVersionMinorKeyInit = minor;
mVersionMicroKeyInit = micro;
}
void GetVersionKeysInit( int& major, int& minor, int& micro) const
{
major = mVersionMajorKeyInit;
minor = mVersionMinorKeyInit;
micro = mVersionMicroKeyInit;
}
protected:
virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE;
virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE;
@@ -39,7 +53,14 @@ protected:
private:
void Warn(bool canRetry = true);
FilePath mConfigPath;
const FilePath mConfigPath;
// values of the version major/minor/micro keys in audacity.cfg
// when Audacity first opens
int mVersionMajorKeyInit{};
int mVersionMinorKeyInit{};
int mVersionMicroKeyInit{};
bool mDirty;
};