mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Demote Get/SetVersionKeysInit from AudacityPrefs into FileConfig
This commit is contained in:
24
src/Prefs.h
24
src/Prefs.h
@@ -50,9 +50,7 @@ extern AUDACITY_DLL_API AudacityPrefs *gPrefs;
|
|||||||
extern int gMenusDirty;
|
extern int gMenusDirty;
|
||||||
|
|
||||||
|
|
||||||
/// \brief Our own specialisation of wxFileConfig. It is essentially a renaming,
|
/// \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.
|
|
||||||
class AUDACITY_DLL_API AudacityPrefs : public FileConfig
|
class AUDACITY_DLL_API AudacityPrefs : public FileConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -62,26 +60,6 @@ public:
|
|||||||
const wxString& globalFilename = {},
|
const wxString& globalFilename = {},
|
||||||
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
|
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE,
|
||||||
const wxMBConv& conv = wxConvAuto());
|
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{};
|
struct ByColumns_t{};
|
||||||
|
|||||||
@@ -29,6 +29,20 @@ public:
|
|||||||
|
|
||||||
virtual bool Flush(bool bCurrentOnly = false) wxOVERRIDE;
|
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:
|
protected:
|
||||||
virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE;
|
virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE;
|
||||||
virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE;
|
virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE;
|
||||||
@@ -39,7 +53,14 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void Warn(bool canRetry = true);
|
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;
|
bool mDirty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user