1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 08:59:28 +02:00

Remove unnecessary initializers for empty wxString

This commit is contained in:
Paul Licameli 2019-03-15 14:41:21 -04:00
parent 135c2a71ce
commit 06b3b42794
24 changed files with 32 additions and 45 deletions

View File

@ -450,7 +450,7 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )
// create a html pane in it to put the content in. // create a html pane in it to put the content in.
wxString enabled = _("Enabled"); wxString enabled = _("Enabled");
wxString disabled = _("Disabled"); wxString disabled = _("Disabled");
wxString blank = wxT(""); wxString blank;
/* this builds up the list of information to go in the window in the string /* this builds up the list of information to go in the window in the string
* informationStr */ * informationStr */

View File

@ -1753,7 +1753,7 @@ bool AudacityApp::InitTempDir()
wxString tempFromPrefs = gPrefs->Read(wxT("/Directories/TempDir"), wxT("")); wxString tempFromPrefs = gPrefs->Read(wxT("/Directories/TempDir"), wxT(""));
wxString tempDefaultLoc = wxGetApp().defaultTempDir; wxString tempDefaultLoc = wxGetApp().defaultTempDir;
wxString temp = wxT(""); wxString temp;
#ifdef __WXGTK__ #ifdef __WXGTK__
if (tempFromPrefs.length() > 0 && tempFromPrefs[0] != wxT('/')) if (tempFromPrefs.length() > 0 && tempFromPrefs[0] != wxT('/'))

View File

@ -90,7 +90,6 @@ static const std::pair<const wxChar*, const wxChar*> SpecialCommands[] = {
MacroCommands::MacroCommands() MacroCommands::MacroCommands()
{ {
mMessage = "";
ResetMacro(); ResetMacro();
auto names = GetNames(); auto names = GetNames();

View File

@ -533,7 +533,7 @@ void DependencyDialog::OnRightClick( wxListEvent& event)
void DependencyDialog::OnCopyToClipboard( wxCommandEvent& evt ) void DependencyDialog::OnCopyToClipboard( wxCommandEvent& evt )
{ {
static_cast<void>(evt); static_cast<void>(evt);
wxString Files = ""; wxString Files;
for (const auto &aliasedFile : mAliasedFiles) { for (const auto &aliasedFile : mAliasedFiles) {
const wxFileName & fileName = aliasedFile.mFileName; const wxFileName & fileName = aliasedFile.mFileName;
wxLongLong byteCount = (aliasedFile.mByteCount * 124) / 100; wxLongLong byteCount = (aliasedFile.mByteCount * 124) / 100;

View File

@ -2799,7 +2799,7 @@ bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgrou
wxString path = GetSettings()->GetPath(); wxString path = GetSettings()->GetPath();
GetSettings()->SetPath(group); GetSettings()->SetPath(group);
wxString name = wxEmptyString; wxString name;
long index = 0; long index = 0;
if (GetSettings()->GetFirstGroup(name, index)) if (GetSettings()->GetFirstGroup(name, index))
{ {
@ -2832,7 +2832,7 @@ bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxSt
if (!key.empty()) if (!key.empty())
{ {
wxString wxval = wxEmptyString; wxString wxval;
result = GetSettings()->Read(key, &wxval, defval); result = GetSettings()->Read(key, &wxval, defval);

View File

@ -2467,7 +2467,6 @@ public:
p->Raise(); // May help identifying the window on Mac p->Raise(); // May help identifying the window on Mac
// Construct this projects name and number. // Construct this projects name and number.
sProjNumber = "";
sProjName = p->GetName(); sProjName = p->GetName();
if (sProjName.empty()){ if (sProjName.empty()){
sProjName = _("<untitled>"); sProjName = _("<untitled>");
@ -3873,7 +3872,7 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
// Always save a backup of the original project file // Always save a backup of the original project file
// //
wxString safetyFileName = wxT(""); wxString safetyFileName;
if (wxFileExists(mFileName)) { if (wxFileExists(mFileName)) {
#ifdef __WXGTK__ #ifdef __WXGTK__
@ -4308,7 +4307,7 @@ void AudacityProject::ZoomAfterImport(Track *pTrack)
bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArray /*= NULL*/) bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArray /*= NULL*/)
{ {
TrackHolders newTracks; TrackHolders newTracks;
wxString errorMessage = wxEmptyString; wxString errorMessage;
{ {
// Backup Tags, before the import. Be prepared to roll back changes. // Backup Tags, before the import. Be prepared to roll back changes.
@ -4479,7 +4478,7 @@ For an audio file that will open in other apps, use 'Export'.\n");
} }
bool bPrompt = (mBatchMode == 0) || (mFileName.empty()); bool bPrompt = (mBatchMode == 0) || (mFileName.empty());
wxString fName = ""; wxString fName;
if (bPrompt) { if (bPrompt) {
// JKC: I removed 'wxFD_OVERWRITE_PROMPT' because we are checking // JKC: I removed 'wxFD_OVERWRITE_PROMPT' because we are checking
@ -5436,7 +5435,7 @@ bool AudacityProject::SaveFromTimerRecording(wxFileName fnFile) {
// MY: To allow SaveAs from Timer Recording we need to check what // MY: To allow SaveAs from Timer Recording we need to check what
// the value of mFileName is before we change it. // the value of mFileName is before we change it.
wxString sOldFilename = ""; wxString sOldFilename;
if (IsProjectSaved()) { if (IsProjectSaved()) {
sOldFilename = mFileName; sOldFilename = mFileName;
} }
@ -5477,7 +5476,7 @@ bool AudacityProject::ProjectHasTracks() {
wxString AudacityProject::GetHoursMinsString(int iMinutes) wxString AudacityProject::GetHoursMinsString(int iMinutes)
{ {
wxString sFormatted = wxEmptyString; wxString sFormatted;
if (iMinutes < 1) { if (iMinutes < 1) {
// Less than a minute... // Less than a minute...

View File

@ -47,7 +47,7 @@ class ShuttleCli final : public Shuttle
{ {
public: public:
wxString mParams; wxString mParams;
ShuttleCli(){ mParams = wxT("") ;} ShuttleCli() {}
virtual ~ShuttleCli() {} virtual ~ShuttleCli() {}
bool ExchangeWithMaster(const wxString & Name) override; bool ExchangeWithMaster(const wxString & Name) override;
}; };
@ -63,7 +63,7 @@ public:
wxString mParams; wxString mParams;
bool *pOptionalFlag; bool *pOptionalFlag;
CommandParameters * mpEap; CommandParameters * mpEap;
ShuttleParams(){ mParams = wxT("") ;mpEap=NULL;pOptionalFlag=NULL;} ShuttleParams() { mpEap = NULL; pOptionalFlag = NULL; }
virtual ~ShuttleParams() {} virtual ~ShuttleParams() {}
bool ExchangeWithMaster(const wxString & Name) override; bool ExchangeWithMaster(const wxString & Name) override;
bool ShouldSet(); bool ShouldSet();

View File

@ -416,13 +416,13 @@ void TimerRecordDialog::OnOK(wxCommandEvent& WXUNUSED(event))
if (iMinsRecording >= iMinsLeft) { if (iMinsRecording >= iMinsLeft) {
// Format the strings // Format the strings
wxString sRemainingTime = ""; wxString sRemainingTime;
sRemainingTime = pProject->GetHoursMinsString(iMinsLeft); sRemainingTime = pProject->GetHoursMinsString(iMinsLeft);
wxString sPlannedTime = ""; wxString sPlannedTime;
sPlannedTime = pProject->GetHoursMinsString(iMinsRecording); sPlannedTime = pProject->GetHoursMinsString(iMinsRecording);
// Create the message string // Create the message string
wxString sMessage = ""; wxString sMessage;
sMessage.Printf(_("You may not have enough free disk space to complete this Timer Recording, based on your current settings.\n\nDo you wish to continue?\n\nPlanned recording duration: %s\nRecording time remaining on disk: %s"), sMessage.Printf(_("You may not have enough free disk space to complete this Timer Recording, based on your current settings.\n\nDo you wish to continue?\n\nPlanned recording duration: %s\nRecording time remaining on disk: %s"),
sPlannedTime, sPlannedTime,
sRemainingTime); sRemainingTime);
@ -890,7 +890,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
(bAutoSave ? "true" : "false")); (bAutoSave ? "true" : "false"));
S.StartMultiColumn(3, wxEXPAND); S.StartMultiColumn(3, wxEXPAND);
{ {
wxString sInitialValue = wxT(""); wxString sInitialValue;
AudacityProject* pProject = GetActiveProject(); AudacityProject* pProject = GetActiveProject();
wxString sSaveValue = pProject->GetFileName(); wxString sSaveValue = pProject->GetFileName();
if (!sSaveValue.empty()) { if (!sSaveValue.empty()) {

View File

@ -1080,7 +1080,7 @@ wxString CommandManager::GetLabelWithDisabledAccel(const CommandListEntry *entry
{ {
wxString label = entry->label; wxString label = entry->label;
#if 1 #if 1
wxString Accel = ""; wxString Accel;
do{ do{
if (!entry->key.empty()) if (!entry->key.empty())
{ {
@ -1253,7 +1253,7 @@ void CommandManager::TellUserWhyDisallowed( const wxString & Name, CommandFlag f
wxString reason = _("There was a problem with your last action. If you think\nthis is a bug, please tell us exactly where it occurred."); wxString reason = _("There was a problem with your last action. If you think\nthis is a bug, please tell us exactly where it occurred.");
// The default title string is 'Disallowed'. // The default title string is 'Disallowed'.
wxString title = _("Disallowed"); wxString title = _("Disallowed");
wxString helpPage =""; wxString helpPage;
auto missingFlags = flagsRequired & (~flagsGot ); auto missingFlags = flagsRequired & (~flagsGot );
if( missingFlags & AudioIONotBusyFlag ) if( missingFlags & AudioIONotBusyFlag )

View File

@ -136,7 +136,7 @@ void LispyCommandMessageTarget::EndStruct(){
Update( ")" ); Update( ")" );
} }
void LispyCommandMessageTarget::AddItem(const wxString &value, const wxString &name){ void LispyCommandMessageTarget::AddItem(const wxString &value, const wxString &name){
wxString Padding = ""; wxString Padding;
if( name.empty() ) if( name.empty() )
Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?" ":"", Padding, Escaped(value))); Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?" ":"", Padding, Escaped(value)));
else else

View File

@ -77,7 +77,7 @@ wxString NormalizedKeyString::Display(bool usesSpecialChars) const
NormalizedKeyString KeyEventToKeyString(const wxKeyEvent & event) NormalizedKeyString KeyEventToKeyString(const wxKeyEvent & event)
{ {
wxString newStr = wxT(""); wxString newStr;
long key = event.GetKeyCode(); long key = event.GetKeyCode();

View File

@ -1345,7 +1345,7 @@ void EffectEqualization::LoadCurves(const wxString &fileName, bool append)
if(fileName.empty()) { if(fileName.empty()) {
// Check if presets are up to date. // Check if presets are up to date.
wxString eqCurvesCurrentVersion = wxString::Format(wxT("%d.%d"), EQCURVES_VERSION, EQCURVES_REVISION); wxString eqCurvesCurrentVersion = wxString::Format(wxT("%d.%d"), EQCURVES_VERSION, EQCURVES_REVISION);
wxString eqCurvesInstalledVersion = wxT(""); wxString eqCurvesInstalledVersion;
gPrefs->Read(wxT("/Effects/Equalization/PresetVersion"), &eqCurvesInstalledVersion, wxT("")); gPrefs->Read(wxT("/Effects/Equalization/PresetVersion"), &eqCurvesInstalledVersion, wxT(""));
bool needUpdate = (eqCurvesCurrentVersion != eqCurvesInstalledVersion); bool needUpdate = (eqCurvesCurrentVersion != eqCurvesInstalledVersion);
@ -3490,7 +3490,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event)) void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
{ {
FileDialogWrapper filePicker(this, _("Choose an EQ curve file"), FileNames::DataDir(), wxT(""), _("xml files (*.xml;*.XML)|*.xml;*.XML")); FileDialogWrapper filePicker(this, _("Choose an EQ curve file"), FileNames::DataDir(), wxT(""), _("xml files (*.xml;*.XML)|*.xml;*.XML"));
wxString fileName = wxT(""); wxString fileName;
if( filePicker.ShowModal() == wxID_CANCEL) if( filePicker.ShowModal() == wxID_CANCEL)
return; return;
else else
@ -3510,7 +3510,7 @@ void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event)) void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
{ {
FileDialogWrapper filePicker(this, _("Export EQ curves as..."), FileNames::DataDir(), wxT(""), wxT("*.XML"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR? FileDialogWrapper filePicker(this, _("Export EQ curves as..."), FileNames::DataDir(), wxT(""), wxT("*.XML"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
wxString fileName = wxT(""); wxString fileName;
if( filePicker.ShowModal() == wxID_CANCEL) if( filePicker.ShowModal() == wxID_CANCEL)
return; return;
else else

View File

@ -129,8 +129,6 @@ NyquistEffect::NyquistEffect(const wxString &fName)
mOutputTrack[0] = mOutputTrack[1] = nullptr; mOutputTrack[0] = mOutputTrack[1] = nullptr;
mAction = XO("Applying Nyquist Effect..."); mAction = XO("Applying Nyquist Effect...");
mInputCmd = wxEmptyString;
mCmd = wxEmptyString;
mIsPrompt = false; mIsPrompt = false;
mExternal = false; mExternal = false;
mCompiler = false; mCompiler = false;
@ -706,7 +704,7 @@ bool NyquistEffect::Process()
int numLabel = 0; int numLabel = 0;
int numMidi = 0; int numMidi = 0;
int numTime = 0; int numTime = 0;
wxString waveTrackList = wxT(""); // track positions of selected audio tracks. wxString waveTrackList; // track positions of selected audio tracks.
{ {
auto countRange = project->GetTracks()->Leaders(); auto countRange = project->GetTracks()->Leaders();
@ -2637,7 +2635,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S)
S.AddSpace(10, 10); S.AddSpace(10, 10);
// Get default file extension if specified in wildcards // Get default file extension if specified in wildcards
wxString defaultExtension = ""; wxString defaultExtension;
size_t len = ctrl.lowStr.length(); size_t len = ctrl.lowStr.length();
int characters = ctrl.lowStr.Find("*"); int characters = ctrl.lowStr.Find("*");
@ -2949,7 +2947,7 @@ void NyquistEffect::OnFileButton(wxCommandEvent& evt)
return; return;
} }
wxString path = ""; wxString path;
// When multiple files selected, return file paths as a list of quoted strings. // When multiple files selected, return file paths as a list of quoted strings.
if (flags & wxFD_MULTIPLE) if (flags & wxFD_MULTIPLE)
{ {

View File

@ -282,7 +282,6 @@ Exporter::Exporter()
{ {
mMixerSpec = NULL; mMixerSpec = NULL;
mBook = NULL; mBook = NULL;
mFormatName = "";
SetFileDialogTitle( _("Export Audio") ); SetFileDialogTitle( _("Export Audio") );

View File

@ -2002,7 +2002,7 @@ int ExportMP3::AskResample(int bitrate, int rate, int lowrate, int highrate)
S.EndHorizontalLay(); S.EndHorizontalLay();
wxArrayString choices; wxArrayString choices;
wxString selected = wxT(""); wxString selected;
for (size_t i = 0; i < WXSIZEOF(sampRates); i++) { for (size_t i = 0; i < WXSIZEOF(sampRates); i++) {
int label = sampRates[i].label; int label = sampRates[i].label;
if (label >= lowrate && label <= highrate) { if (label >= lowrate && label <= highrate) {

View File

@ -152,7 +152,7 @@ void Importer::ReadImportItems()
*/ */
for (item_counter = 0; true; item_counter++) for (item_counter = 0; true; item_counter++)
{ {
wxString condition, filters, used_filters, unused_filters = wxEmptyString, extensions, mime_types = wxEmptyString; wxString condition, filters, used_filters, unused_filters, extensions, mime_types;
item_name.Printf (wxT("/ExtImportItems/Item%d"), item_counter); item_name.Printf (wxT("/ExtImportItems/Item%d"), item_counter);
/* Break at first non-existent item */ /* Break at first non-existent item */
if (!gPrefs->Read(item_name, &item_value)) if (!gPrefs->Read(item_name, &item_value))

View File

@ -439,7 +439,7 @@ bool FFmpegImportFileHandle::InitCodecs()
duration = sc->m_stream->duration * sc->m_stream->time_base.num / sc->m_stream->time_base.den; duration = sc->m_stream->duration * sc->m_stream->time_base.num / sc->m_stream->time_base.den;
else else
duration = mFormatContext->duration / AV_TIME_BASE; duration = mFormatContext->duration / AV_TIME_BASE;
wxString bitrate = wxT(""); wxString bitrate;
if (sc->m_codecCtx->bit_rate > 0) if (sc->m_codecCtx->bit_rate > 0)
bitrate.Printf(wxT("%d"),(int)sc->m_codecCtx->bit_rate); bitrate.Printf(wxT("%d"),(int)sc->m_codecCtx->bit_rate);
else else

View File

@ -511,7 +511,7 @@ void QTImportFileHandle::AddMetadata(Tags *tags)
if (err != noErr) if (err != noErr)
continue; continue;
wxString v = wxT(""); wxString v;
switch (dataType) switch (dataType)
{ {

View File

@ -332,7 +332,7 @@ void OnExportMIDI(const CommandContext &context)
while(true) { while(true) {
wxString fName = wxT(""); wxString fName;
fName = FileNames::SelectFile(FileNames::Operation::Export, fName = FileNames::SelectFile(FileNames::Operation::Export,
_("Export MIDI As:"), _("Export MIDI As:"),

View File

@ -265,7 +265,7 @@ void AddEffectMenuItems(
name += wxT("..."); name += wxT("...");
} }
wxString group = wxEmptyString; wxString group;
if (groupBy == wxT("sortby:publisher:name")) if (groupBy == wxT("sortby:publisher:name"))
{ {
group = EffectManager::Get().GetVendorName(plug->GetID()); group = EffectManager::Get().GetVendorName(plug->GetID());

View File

@ -1121,7 +1121,6 @@ const wxString &Scrubber::GetUntranslatedStateString() const
wxString Scrubber::StatusMessageForWave() const wxString Scrubber::StatusMessageForWave() const
{ {
wxString result; wxString result;
result = "";
if( Seeks() ) if( Seeks() )
result = _("Move mouse pointer to Seek"); result = _("Move mouse pointer to Seek");

View File

@ -607,11 +607,6 @@ NumericConverter::NumericConverter(Type type,
if (type == NumericConverter::TIME ) if (type == NumericConverter::TIME )
mDefaultNdx = 4; // Default to "hh:mm:ss + milliseconds". mDefaultNdx = 4; // Default to "hh:mm:ss + milliseconds".
mPrefix = wxT("");
mValueTemplate = wxT("");
mValueMask = wxT("");
mValueString = wxT("");
mScalingFactor = 1.0f; mScalingFactor = 1.0f;
mSampleRate = 1.0f; mSampleRate = 1.0f;
mNtscDrop = false; mNtscDrop = false;

View File

@ -85,7 +85,6 @@ Ruler::Ruler()
mFlip = false; mFlip = false;
mLog = false; mLog = false;
mLabelEdges = false; mLabelEdges = false;
mUnits = wxT("");
mLeft = -1; mLeft = -1;
mTop = -1; mTop = -1;

View File

@ -29,7 +29,6 @@ XMLFileReader::XMLFileReader()
XML_SetElementHandler(mParser, startElement, endElement); XML_SetElementHandler(mParser, startElement, endElement);
XML_SetCharacterDataHandler(mParser, charHandler); XML_SetCharacterDataHandler(mParser, charHandler);
mBaseHandler = NULL; mBaseHandler = NULL;
mErrorStr = wxT("");
mHandler.reserve(128); mHandler.reserve(128);
} }