1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Sweep unnecessary wxString copies: prefs

This commit is contained in:
Paul Licameli 2016-02-22 21:16:26 -05:00
parent 2efa24bc10
commit 0ce4fe0b83
5 changed files with 7 additions and 7 deletions

View File

@ -138,7 +138,7 @@ bool ModulePrefs::Apply()
// static function that tells us about a module.
int ModulePrefs::GetModuleStatus( wxString fname ){
int ModulePrefs::GetModuleStatus(const wxString &fname){
// Default status is NEW module, and we will ask once.
int iStatus = kModuleNew;
@ -152,7 +152,7 @@ int ModulePrefs::GetModuleStatus( wxString fname ){
return iStatus;
}
void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){
void ModulePrefs::SetModuleStatus(const wxString &fname, int iStatus){
wxString ShortName = wxFileName( fname ).GetName();
wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower();
gPrefs->Write( PrefName, iStatus );

View File

@ -38,8 +38,8 @@ class ModulePrefs:public PrefsPanel
~ModulePrefs();
virtual bool Apply();
static int GetModuleStatus( wxString fname );
static void SetModuleStatus( wxString fname, int iStatus );
static int GetModuleStatus( const wxString &fname );
static void SetModuleStatus( const wxString &fname, int iStatus );
private:
void GetAllModuleStatuses();

View File

@ -448,7 +448,7 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
EndModal(true);
}
void PrefsDialog::SelectPageByName(wxString pageName)
void PrefsDialog::SelectPageByName(const wxString &pageName)
{
if (mCategories) {
size_t n = mCategories->GetPageCount();

View File

@ -61,7 +61,7 @@ class PrefsDialog:public wxDialog
void OnApply(wxCommandEvent & e);
void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when enter is pressed with focus on tree
void SelectPageByName(wxString pageName);
void SelectPageByName(const wxString &pageName);
// Accessor to help implementations of SavePreferredPage(),
// such as by saving a preference after DoModal() returns

View File

@ -43,7 +43,7 @@ ThemePrefs.
class PrefsPanel:public wxPanel
{
public:
PrefsPanel(wxWindow * parent, wxString title)
PrefsPanel(wxWindow * parent, const wxString &title)
: wxPanel(parent, wxID_ANY)
{
SetLabel(title); // Provide visual label