diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 1f03cc79a..4f170f7ae 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1298,7 +1298,7 @@ bool AudacityApp::OnInit() wxString home = wxGetHomeDir(); wxString envTempDir = wxGetenv(wxT("TMPDIR")); - if (envTempDir != wxT("")) { + if (!envTempDir.empty()) { /* On Unix systems, the environment variable TMPDIR may point to an unusual path when /tmp and /var/tmp are not desirable. */ defaultTempDir.Printf(wxT("%s/audacity-%s"), envTempDir, wxGetUserId()); @@ -1313,7 +1313,7 @@ bool AudacityApp::OnInit() #else wxString pathVar = wxGetenv(wxT("DARKAUDACITY_PATH")); #endif - if (pathVar != wxT("")) + if (!pathVar.empty()) AddMultiPathsToPathList(pathVar, audacityPathList); AddUniquePathToPathList(::wxGetCwd(), audacityPathList); @@ -1770,7 +1770,7 @@ bool AudacityApp::InitTempDir() // If that didn't work, try the default location - if (temp==wxT("")) + if (temp.empty()) SetToExtantDirectory( temp, tempDefaultLoc ); // Check temp directory ownership on *nix systems only @@ -1786,7 +1786,7 @@ bool AudacityApp::InitTempDir() } #endif - if (temp == wxT("")) { + if (temp.empty()) { // Failed if( !IsTempDirectoryNameOK( tempFromPrefs ) ) { AudacityMessageBox(_("Audacity could not find a safe place to store temporary files.\nAudacity needs a place where automatic cleanup programs won't delete the temporary files.\nPlease enter an appropriate directory in the preferences dialog.")); @@ -2095,7 +2095,7 @@ void AudacityApp::AddMultiPathsToPathList(const wxString &multiPathStringArg, wxArrayString &pathList) { wxString multiPathString(multiPathStringArg); - while (multiPathString != wxT("")) { + while (!multiPathString.empty()) { wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]); multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]); AddUniquePathToPathList(onePath, pathList); @@ -2110,7 +2110,7 @@ void AudacityApp::FindFilesInPathList(const wxString & pattern, { wxLogNull nolog; - if (pattern == wxT("")) { + if (pattern.empty()) { return; } diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index c1bcfb9bb..d35cec479 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -938,7 +938,7 @@ void InitAudioIO() #endif // Make sure device prefs are initialized - if (gPrefs->Read(wxT("AudioIO/RecordingDevice"), wxT("")) == wxT("")) { + if (gPrefs->Read(wxT("AudioIO/RecordingDevice"), wxT("")).empty()) { int i = AudioIO::getRecordDevIndex(); const PaDeviceInfo *info = Pa_GetDeviceInfo(i); if (info) { @@ -947,7 +947,7 @@ void InitAudioIO() } } - if (gPrefs->Read(wxT("AudioIO/PlaybackDevice"), wxT("")) == wxT("")) { + if (gPrefs->Read(wxT("AudioIO/PlaybackDevice"), wxT("")).empty()) { int i = AudioIO::getPlayDevIndex(); const PaDeviceInfo *info = Pa_GetDeviceInfo(i); if (info) { diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 830ecd0a7..03d6b72da 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -936,7 +936,7 @@ bool MacroCommands::ReportAndSkip( return false; //TODO: Add a cancel button to these, and add the logic so that we can abort. - if( params != wxT("") ) + if( !params.empty() ) { AudacityMessageBox( wxString::Format(_("Apply %s with parameter(s)\n\n%s"),friendlyCommand, params), _("Test Mode")); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 933ad43c3..9697372a4 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -1070,7 +1070,7 @@ void MacrosWindow::InsertCommandAt(int item) } Raise(); - if(d.mSelectedCommand != wxT("")) + if(!d.mSelectedCommand.empty()) { mMacroCommands.AddToMacro(d.mSelectedCommand, d.mSelectedParameters, diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index a922c07c3..7a1ae3089 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -263,7 +263,7 @@ void BenchmarkDialog::OnSave( wxCommandEvent & WXUNUSED(event)) wxFD_SAVE | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return; mText->SaveFile(fName); diff --git a/src/DirManager.cpp b/src/DirManager.cpp index 57c694e8c..a1dfee0a0 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -589,7 +589,7 @@ DirManager::ProjectSetter::Impl::Impl( , moving{ moving_ } { // Choose new paths - if (newProjPath == wxT("")) + if (newProjPath.empty()) newProjPath = ::wxGetCwd(); dirManager.projPath = newProjPath; @@ -815,7 +815,7 @@ wxLongLong DirManager::GetFreeDiskSpace() wxString DirManager::GetDataFilesDir() const { - return projFull != wxT("")? projFull: mytemp; + return !projFull.empty()? projFull: mytemp; } void DirManager::SetLocalTempDir(const wxString &path) @@ -1031,7 +1031,7 @@ void DirManager::BalanceInfoDel(const wxString &file) dirMidPool.erase(midkey); // DELETE the actual directory - wxString dir=(projFull != wxT("")? projFull: mytemp); + wxString dir=(!projFull.empty()? projFull: mytemp); dir += wxFILE_SEP_PATH; dir += file.Mid(0,3); dir += wxFILE_SEP_PATH; @@ -1051,7 +1051,7 @@ void DirManager::BalanceInfoDel(const wxString &file) if(--dirTopPool[topnum]<1){ // do *not* erase the hash entry from dirTopPool // *do* DELETE the actual directory - dir=(projFull != wxT("")? projFull: mytemp); + dir=(!projFull.empty()? projFull: mytemp); dir += wxFILE_SEP_PATH; dir += file.Mid(0,3); wxFileName::Rmdir(dir); @@ -1695,7 +1695,7 @@ int DirManager::ProjectFSCK(const bool bForceError, const bool bAutoRecoverMode) } wxArrayString filePathArray; // *all* files in the project directory/subdirectories - wxString dirPath = (projFull != wxT("") ? projFull : mytemp); + wxString dirPath = (!projFull.empty() ? projFull : mytemp); RecursivelyEnumerateWithProgress( dirPath, filePathArray, // output: all files in project directory tree @@ -2151,7 +2151,7 @@ void DirManager::FindOrphanBlockFiles( void DirManager::RemoveOrphanBlockfiles() { wxArrayString filePathArray; // *all* files in the project directory/subdirectories - wxString dirPath = (projFull != wxT("") ? projFull : mytemp); + wxString dirPath = (!projFull.empty() ? projFull : mytemp); RecursivelyEnumerateWithProgress( dirPath, filePathArray, // output: all files in project directory tree diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index 2872bba51..b249effd5 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -1053,7 +1053,7 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event)) _("Export Spectral Data As:"), wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return; wxTextFile f(fName); diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 0eb9a13ea..eca1b2f7a 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -630,7 +630,7 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event)) this); // Parent // They gave us one... - if (fileName != wxT("")) { + if (!fileName.empty()) { wxTextFile f; // Get at the data @@ -678,7 +678,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event)) wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return; // Move existing files out of the way. Otherwise wxTextFile will diff --git a/src/LabelTrack.cpp b/src/LabelTrack.cpp index 6a2d36e6f..e8f932c26 100644 --- a/src/LabelTrack.cpp +++ b/src/LabelTrack.cpp @@ -286,7 +286,7 @@ void LabelTrack::RestoreFlags( const Flags& flags ) wxFont LabelTrack::GetFont(const wxString &faceName, int size) { wxFontEncoding encoding; - if (faceName == wxT("")) + if (faceName.empty()) encoding = wxFONTENCODING_DEFAULT; else encoding = wxFONTENCODING_SYSTEM; diff --git a/src/Languages.cpp b/src/Languages.cpp index 7acfc9c4a..ef38ae7ee 100644 --- a/src/Languages.cpp +++ b/src/Languages.cpp @@ -241,10 +241,10 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames) if (fullCode.length() < 2) continue; - if (localLanguageName[code] != wxT("")) { + if (!localLanguageName[code].empty()) { name = localLanguageName[code]; } - if (localLanguageName[fullCode] != wxT("")) { + if (!localLanguageName[fullCode].empty()) { name = localLanguageName[fullCode]; } @@ -252,7 +252,7 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames) code = fullCode; } - if (tempHash[code] != wxT("")) + if (!tempHash[code].empty()) continue; if (TranslationExists(audacityPathList, code) || code==wxT("en")) { diff --git a/src/ModuleManager.cpp b/src/ModuleManager.cpp index 81e83fd3b..d9eea5b91 100755 --- a/src/ModuleManager.cpp +++ b/src/ModuleManager.cpp @@ -220,7 +220,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler) // Code from LoadLadspa that might be useful in load modules. pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH")); - if (pathVar != wxT("")) + if (!pathVar.empty()) wxGetApp().AddMultiPathsToPathList(pathVar, pathList); for (i = 0; i < audacityPathList.size(); i++) { @@ -355,7 +355,7 @@ bool ModuleManager::DiscoverProviders() // Code from LoadLadspa that might be useful in load modules. wxString pathVar = wxString::FromUTF8(getenv("AUDACITY_MODULES_PATH")); - if (pathVar != wxT("")) + if (!pathVar.empty()) { wxGetApp().AddMultiPathsToPathList(pathVar, pathList); } diff --git a/src/Project.cpp b/src/Project.cpp index 57fffe277..c9934beff 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -3898,7 +3898,7 @@ bool AudacityProject::DoSave (const bool fromSaveAs, wxString project, projName, projPath; auto cleanup = finally( [&] { - if (safetyFileName != wxT("")) { + if (!safetyFileName.empty()) { if (wxFileExists(mFileName)) wxRemove(mFileName); wxRename(safetyFileName, mFileName); @@ -4071,7 +4071,7 @@ bool AudacityProject::DoSave (const bool fromSaveAs, // If we get here, saving the project was successful, so we can DELETE // the .bak file (because it now does not fit our block files anymore // anyway). - if (safetyFileName != wxT("")) + if (!safetyFileName.empty()) wxRemoveFile(safetyFileName), // cancel the cleanup: safetyFileName = wxT(""); @@ -4495,7 +4495,7 @@ For an audio file that will open in other apps, use 'Export'.\n"); wxFD_SAVE | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return false; filename = fName; @@ -5395,7 +5395,7 @@ bool AudacityProject::IsProjectSaved() { // Otherwise it becomes true only when a project is first saved successfully // in DirManager::SetProject wxString sProjectName = mDirManager->GetProjectName(); - return (sProjectName != wxT("")); + return (!sProjectName.empty()); } // This is done to empty out the tracks, but without creating a new project. diff --git a/src/Screenshot.cpp b/src/Screenshot.cpp index c75e7fb04..4fe1816cc 100644 --- a/src/Screenshot.cpp +++ b/src/Screenshot.cpp @@ -541,7 +541,7 @@ void ScreenFrame::OnDirChoose(wxCommandEvent & WXUNUSED(event)) current); dlog.ShowModal(); - if (dlog.GetPath() != wxT("")) { + if (!dlog.GetPath().empty()) { wxFileName tmpDirPath; tmpDirPath.AssignDir(dlog.GetPath()); wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR); diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index ca5a313cd..f42103d17 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -312,7 +312,7 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even wxFD_SAVE | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return; AudacityProject* pProject = GetActiveProject(); diff --git a/src/commands/BatchEvalCommand.cpp b/src/commands/BatchEvalCommand.cpp index d39c4556e..ee80537de 100644 --- a/src/commands/BatchEvalCommand.cpp +++ b/src/commands/BatchEvalCommand.cpp @@ -45,7 +45,7 @@ bool BatchEvalCommand::Apply(const CommandContext & context) MacroCommandsCatalog catalog(&context.project); wxString macroName = GetString(wxT("MacroName")); - if (macroName != wxT("")) + if (!macroName.empty()) { MacroCommands batch; batch.ReadMacro(macroName); diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index d958e99a4..2cd3b63d8 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -769,7 +769,7 @@ void CommandManager::AddItem(const wxChar *name, wxString cookedParameter; const auto ¶meter = options.parameter; - if( parameter == "" ) + if( parameter.empty() ) cookedParameter = name; else cookedParameter = parameter; diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index d75d14b38..95f0dbaaf 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -786,7 +786,7 @@ wxRect ScreenshotCommand::GetTrackRect( AudacityProject * pProj, TrackPanel * pa } wxString ScreenshotCommand::WindowFileName(AudacityProject * proj, wxTopLevelWindow *w){ - if (w != proj && w->GetTitle() != wxT("")) { + if (w != proj && !w->GetTitle().empty()) { mFileName = MakeFileName(mFilePath, kCaptureWhatStrings[ mCaptureMode ].Translation() + (wxT("-") + w->GetTitle() + wxT("-"))); diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index a8c0f67f9..f5ab214b3 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -505,7 +505,7 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event)) wxFD_SAVE | wxRESIZE_BORDER, this); - if (fName == wxT("")) + if (fName.empty()) return; wxTextFile f(fName); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index da57fe7be..b0f1d103b 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -1342,7 +1342,7 @@ void EffectEqualization::LoadCurves(const wxString &fileName, bool append) // MJS: I don't know what the above means, or if I have broken it. wxFileName fn; - if(fileName == wxT("")) { + if(fileName.empty()) { // Check if presets are up to date. wxString eqCurvesCurrentVersion = wxString::Format(wxT("%d.%d"), EQCURVES_VERSION, EQCURVES_REVISION); wxString eqCurvesInstalledVersion = wxT(""); @@ -1568,7 +1568,7 @@ bool EffectEqualization::GetDefaultFileName(wxFileName &fileName) void EffectEqualization::SaveCurves(const wxString &fileName) { wxFileName fn; - if( fileName == wxT("")) + if( fileName.empty() ) { // Construct default curve filename // @@ -3358,7 +3358,7 @@ void EditCurvesDialog::OnRename(wxCommandEvent & WXUNUSED(event)) } } } - if( name == wxT("") || name == wxT("unnamed") ) + if( name.empty() || name == wxT("unnamed") ) bad = true; } diff --git a/src/export/Export.cpp b/src/export/Export.cpp index b50e9d293..58edbb944 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -204,7 +204,7 @@ bool ExportPlugin::IsExtension(const wxString & ext, int index) wxString defext = GetExtension(i); auto defexts = GetExtensions(i); int indofext = defexts.Index(ext, false); - if (defext == wxT("") || (indofext != wxNOT_FOUND)) + if (defext.empty() || (indofext != wxNOT_FOUND)) isext = true; } return isext; diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index ef18c034c..704c1b8b5 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -391,12 +391,12 @@ void ExportMultiple::EnableControls() bool ok = true; if (mLabel->GetValue() && mFirst->GetValue() && - mFirstFileName->GetValue() == wxT("") && - mPrefix->GetValue() == wxT("")) + mFirstFileName->GetValue().empty() && + mPrefix->GetValue().empty()) ok = false; if (mByNumber->GetValue() && - mPrefix->GetValue() == wxT("")) + mPrefix->GetValue().empty()) ok = false; mExport->Enable(ok); @@ -458,7 +458,7 @@ void ExportMultiple::OnChoose(wxCommandEvent& WXUNUSED(event)) _("Choose a location to save the exported files"), mDir->GetValue()); dlog.ShowModal(); - if (dlog.GetPath() != wxT("")) + if (!dlog.GetPath().empty()) mDir->SetValue(dlog.GetPath()); } diff --git a/src/menus/FileMenus.cpp b/src/menus/FileMenus.cpp index 1f4f5498b..910318244 100644 --- a/src/menus/FileMenus.cpp +++ b/src/menus/FileMenus.cpp @@ -258,7 +258,7 @@ void OnExportLabels(const CommandContext &context) wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, &project); - if (fName == wxT("")) + if (fName.empty()) return; // Move existing files out of the way. Otherwise wxTextFile will @@ -343,7 +343,7 @@ void OnExportMIDI(const CommandContext &context) wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, &project); - if (fName == wxT("")) + if (fName.empty()) return; if(!fName.Contains(wxT("."))) { @@ -445,7 +445,7 @@ void OnImportLabels(const CommandContext &context) wxRESIZE_BORDER, // Flags &project); // Parent - if (fileName != wxT("")) { + if (!fileName.empty()) { wxTextFile f; f.Open(fileName); @@ -487,7 +487,7 @@ void OnImportMIDI(const CommandContext &context) wxRESIZE_BORDER, // Flags &project); // Parent - if (fileName != wxT("")) + if (!fileName.empty()) DoImportMIDI(&project, fileName); } #endif @@ -507,7 +507,7 @@ void OnImportRaw(const CommandContext &context) wxRESIZE_BORDER, // Flags &project); // Parent - if (fileName == wxT("")) + if (fileName.empty()) return; TrackHolders newTracks; diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 3600b30e8..aa59c0afa 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -236,7 +236,7 @@ void DevicePrefs::OnHost(wxCommandEvent & e) wxString recDevice; recDevice = mRecordDevice; - if (this->mRecordSource != wxT("")) + if (!this->mRecordSource.empty()) recDevice += wxT(": ") + mRecordSource; mRecord->Clear(); diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index ce0346061..d4ff8c88e 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -145,7 +145,7 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e) _("Choose a location to place the temporary directory"), oldTempDir ); int retval = dlog.ShowModal(); - if (retval != wxID_CANCEL && dlog.GetPath() != wxT("")) { + if (retval != wxID_CANCEL && !dlog.GetPath().empty()) { wxFileName tmpDirPath; tmpDirPath.AssignDir(dlog.GetPath()); diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index 1d5c8f581..cd7a9911b 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -240,7 +240,7 @@ void DeviceToolBar::UpdatePrefs() devName = gPrefs->Read(wxT("/AudioIO/RecordingDevice"), wxT("")); sourceName = gPrefs->Read(wxT("/AudioIO/RecordingSource"), wxT("")); - if (sourceName == wxT("")) + if (sourceName.empty()) desc = devName; else desc = devName + wxT(": ") + sourceName; @@ -270,7 +270,7 @@ void DeviceToolBar::UpdatePrefs() devName = gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), wxT("")); sourceName = gPrefs->Read(wxT("/AudioIO/PlaybackSource"), wxT("")); - if (sourceName == wxT("")) + if (sourceName.empty()) desc = devName; else desc = devName + wxT(": ") + sourceName; @@ -304,7 +304,7 @@ void DeviceToolBar::UpdatePrefs() if (newChannels > 0 && oldChannels != newChannels) mInputChannels->SetSelection(newChannels - 1); - if (hostName != wxT("") && mHost->GetStringSelection() != hostName) + if (!hostName.empty() && mHost->GetStringSelection() != hostName) mHost->SetStringSelection(hostName); RegenerateTooltips(); @@ -577,7 +577,7 @@ void DeviceToolBar::FillHostDevices() for (i = 0; i < inMaps.size(); i++) { if (foundHostIndex == inMaps[i].hostIndex) { mInput->Append(MakeDeviceSourceString(&inMaps[i])); - if (host == wxT("")) { + if (host.empty()) { host = inMaps[i].hostString; gPrefs->Write(wxT("/AudioIO/Host"), host); mHost->SetStringSelection(host); @@ -592,7 +592,7 @@ void DeviceToolBar::FillHostDevices() for (i = 0; i < outMaps.size(); i++) { if (foundHostIndex == outMaps[i].hostIndex) { mOutput->Append(MakeDeviceSourceString(&outMaps[i])); - if (host == wxT("")) { + if (host.empty()) { host = outMaps[i].hostString; gPrefs->Write(wxT("/AudioIO/Host"), host); gPrefs->Flush(); diff --git a/src/tracks/ui/SelectHandle.cpp b/src/tracks/ui/SelectHandle.cpp index 86d623166..307140f06 100644 --- a/src/tracks/ui/SelectHandle.cpp +++ b/src/tracks/ui/SelectHandle.cpp @@ -970,7 +970,7 @@ HitTestPreview SelectHandle::Preview MaySetOnDemandTip(pTrack.get(), tip); } - if (tip == "") { + if (tip.empty()) { tip = _("Click and drag to select audio"); } if (HasEscape() && mUseSnap) { diff --git a/src/widgets/ErrorDialog.cpp b/src/widgets/ErrorDialog.cpp index a88703349..61ddf0597 100644 --- a/src/widgets/ErrorDialog.cpp +++ b/src/widgets/ErrorDialog.cpp @@ -90,7 +90,7 @@ ErrorDialog::ErrorDialog( long buttonMask; // only add the help button if we have a URL - buttonMask = (helpPage == wxT("")) ? eOkButton : (eHelpButton | eOkButton); + buttonMask = (helpPage.empty()) ? eOkButton : (eHelpButton | eOkButton); dhelpPage = helpPage; dClose = Close; dModal = modal; diff --git a/src/widgets/NumericTextCtrl.cpp b/src/widgets/NumericTextCtrl.cpp index c555b465a..47bda360a 100644 --- a/src/widgets/NumericTextCtrl.cpp +++ b/src/widgets/NumericTextCtrl.cpp @@ -658,27 +658,27 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat) else remainder.ToDouble(&mScalingFactor); i = format.length()-1; // force break out of loop - if (delimStr != wxT("")) + if (!delimStr.empty()) handleDelim = true; - if (numStr != wxT("")) + if (!numStr.empty()) handleNum = true; } else if ((format[i] >= '0' && format[i] <='9') || format[i] == wxT('*') || format[i] == wxT('#')) { numStr += format[i]; - if (delimStr != wxT("")) + if (!delimStr.empty()) handleDelim = true; } else { delimStr += format[i]; - if (numStr != wxT("")) + if (!numStr.empty()) handleNum = true; } if (i == format.length() - 1) { - if (numStr != wxT("")) + if (!numStr.empty()) handleNum = true; - if (delimStr != wxT("")) + if (!delimStr.empty()) handleDelim = true; } diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index ab4508301..197e3bd9d 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -715,7 +715,7 @@ wxString Ruler::LabelString(double d, bool major) } } - if (mUnits != wxT("")) + if (!mUnits.empty()) s = (s + mUnits); return s; @@ -1393,7 +1393,7 @@ void Ruler::Draw(wxDC& dc, const TimeTrack* timetrack) mDC->SetFont(*mMinorMinorFont); for(i=0; i