mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-03 04:47:37 +02:00
Class AudacityPrefs renamed, moved, reused in PluginManager...
... And construction of the main instance is hoisted into AudacityApp
This commit is contained in:
@@ -62,9 +62,9 @@
|
||||
#include "Internat.h"
|
||||
#include "MemoryX.h"
|
||||
|
||||
std::unique_ptr<AudacityPrefs> ugPrefs {};
|
||||
std::unique_ptr<FileConfig> ugPrefs {};
|
||||
|
||||
AudacityPrefs *gPrefs = NULL;
|
||||
FileConfig *gPrefs = nullptr;
|
||||
int gMenusDirty = 0;
|
||||
|
||||
wxDEFINE_EVENT(EVT_PREFS_UPDATE, wxCommandEvent);
|
||||
@@ -171,33 +171,10 @@ static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase
|
||||
}
|
||||
#endif
|
||||
|
||||
AudacityPrefs::AudacityPrefs(const wxString& appName,
|
||||
const wxString& vendorName,
|
||||
const wxString& localFilename,
|
||||
const wxString& globalFilename,
|
||||
long style,
|
||||
const wxMBConv& conv) :
|
||||
FileConfig(appName,
|
||||
vendorName,
|
||||
localFilename,
|
||||
globalFilename,
|
||||
style,
|
||||
conv)
|
||||
void InitPreferences( std::unique_ptr<FileConfig> uPrefs )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void InitPreferences( const wxFileName &configFileName )
|
||||
{
|
||||
wxString appName = wxTheApp->GetAppName();
|
||||
|
||||
ugPrefs = std::make_unique<AudacityPrefs>
|
||||
(appName, wxEmptyString,
|
||||
configFileName.GetFullPath(),
|
||||
wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
|
||||
gPrefs = ugPrefs.get();
|
||||
|
||||
gPrefs = uPrefs.get();
|
||||
ugPrefs = std::move(uPrefs);
|
||||
wxConfigBase::Set(gPrefs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user