mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Replace comparisons against "" with empty()
This commit is contained in:
parent
804b6c8bd8
commit
50074f2cfe
@ -1298,7 +1298,7 @@ bool AudacityApp::OnInit()
|
|||||||
wxString home = wxGetHomeDir();
|
wxString home = wxGetHomeDir();
|
||||||
|
|
||||||
wxString envTempDir = wxGetenv(wxT("TMPDIR"));
|
wxString envTempDir = wxGetenv(wxT("TMPDIR"));
|
||||||
if (envTempDir != wxT("")) {
|
if (!envTempDir.empty()) {
|
||||||
/* On Unix systems, the environment variable TMPDIR may point to
|
/* On Unix systems, the environment variable TMPDIR may point to
|
||||||
an unusual path when /tmp and /var/tmp are not desirable. */
|
an unusual path when /tmp and /var/tmp are not desirable. */
|
||||||
defaultTempDir.Printf(wxT("%s/audacity-%s"), envTempDir, wxGetUserId());
|
defaultTempDir.Printf(wxT("%s/audacity-%s"), envTempDir, wxGetUserId());
|
||||||
@ -1313,7 +1313,7 @@ bool AudacityApp::OnInit()
|
|||||||
#else
|
#else
|
||||||
wxString pathVar = wxGetenv(wxT("DARKAUDACITY_PATH"));
|
wxString pathVar = wxGetenv(wxT("DARKAUDACITY_PATH"));
|
||||||
#endif
|
#endif
|
||||||
if (pathVar != wxT(""))
|
if (!pathVar.empty())
|
||||||
AddMultiPathsToPathList(pathVar, audacityPathList);
|
AddMultiPathsToPathList(pathVar, audacityPathList);
|
||||||
AddUniquePathToPathList(::wxGetCwd(), audacityPathList);
|
AddUniquePathToPathList(::wxGetCwd(), audacityPathList);
|
||||||
|
|
||||||
@ -1770,7 +1770,7 @@ bool AudacityApp::InitTempDir()
|
|||||||
|
|
||||||
// If that didn't work, try the default location
|
// If that didn't work, try the default location
|
||||||
|
|
||||||
if (temp==wxT(""))
|
if (temp.empty())
|
||||||
SetToExtantDirectory( temp, tempDefaultLoc );
|
SetToExtantDirectory( temp, tempDefaultLoc );
|
||||||
|
|
||||||
// Check temp directory ownership on *nix systems only
|
// Check temp directory ownership on *nix systems only
|
||||||
@ -1786,7 +1786,7 @@ bool AudacityApp::InitTempDir()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (temp == wxT("")) {
|
if (temp.empty()) {
|
||||||
// Failed
|
// Failed
|
||||||
if( !IsTempDirectoryNameOK( tempFromPrefs ) ) {
|
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."));
|
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)
|
wxArrayString &pathList)
|
||||||
{
|
{
|
||||||
wxString multiPathString(multiPathStringArg);
|
wxString multiPathString(multiPathStringArg);
|
||||||
while (multiPathString != wxT("")) {
|
while (!multiPathString.empty()) {
|
||||||
wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]);
|
wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]);
|
||||||
multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]);
|
multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]);
|
||||||
AddUniquePathToPathList(onePath, pathList);
|
AddUniquePathToPathList(onePath, pathList);
|
||||||
@ -2110,7 +2110,7 @@ void AudacityApp::FindFilesInPathList(const wxString & pattern,
|
|||||||
{
|
{
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
if (pattern == wxT("")) {
|
if (pattern.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -938,7 +938,7 @@ void InitAudioIO()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make sure device prefs are initialized
|
// 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();
|
int i = AudioIO::getRecordDevIndex();
|
||||||
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
|
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
|
||||||
if (info) {
|
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();
|
int i = AudioIO::getPlayDevIndex();
|
||||||
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
|
const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
|
||||||
if (info) {
|
if (info) {
|
||||||
|
@ -936,7 +936,7 @@ bool MacroCommands::ReportAndSkip(
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//TODO: Add a cancel button to these, and add the logic so that we can abort.
|
//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),
|
AudacityMessageBox( wxString::Format(_("Apply %s with parameter(s)\n\n%s"),friendlyCommand, params),
|
||||||
_("Test Mode"));
|
_("Test Mode"));
|
||||||
|
@ -1070,7 +1070,7 @@ void MacrosWindow::InsertCommandAt(int item)
|
|||||||
}
|
}
|
||||||
Raise();
|
Raise();
|
||||||
|
|
||||||
if(d.mSelectedCommand != wxT(""))
|
if(!d.mSelectedCommand.empty())
|
||||||
{
|
{
|
||||||
mMacroCommands.AddToMacro(d.mSelectedCommand,
|
mMacroCommands.AddToMacro(d.mSelectedCommand,
|
||||||
d.mSelectedParameters,
|
d.mSelectedParameters,
|
||||||
|
@ -263,7 +263,7 @@ void BenchmarkDialog::OnSave( wxCommandEvent & WXUNUSED(event))
|
|||||||
wxFD_SAVE | wxRESIZE_BORDER,
|
wxFD_SAVE | wxRESIZE_BORDER,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mText->SaveFile(fName);
|
mText->SaveFile(fName);
|
||||||
|
@ -589,7 +589,7 @@ DirManager::ProjectSetter::Impl::Impl(
|
|||||||
, moving{ moving_ }
|
, moving{ moving_ }
|
||||||
{
|
{
|
||||||
// Choose new paths
|
// Choose new paths
|
||||||
if (newProjPath == wxT(""))
|
if (newProjPath.empty())
|
||||||
newProjPath = ::wxGetCwd();
|
newProjPath = ::wxGetCwd();
|
||||||
|
|
||||||
dirManager.projPath = newProjPath;
|
dirManager.projPath = newProjPath;
|
||||||
@ -815,7 +815,7 @@ wxLongLong DirManager::GetFreeDiskSpace()
|
|||||||
|
|
||||||
wxString DirManager::GetDataFilesDir() const
|
wxString DirManager::GetDataFilesDir() const
|
||||||
{
|
{
|
||||||
return projFull != wxT("")? projFull: mytemp;
|
return !projFull.empty()? projFull: mytemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirManager::SetLocalTempDir(const wxString &path)
|
void DirManager::SetLocalTempDir(const wxString &path)
|
||||||
@ -1031,7 +1031,7 @@ void DirManager::BalanceInfoDel(const wxString &file)
|
|||||||
dirMidPool.erase(midkey);
|
dirMidPool.erase(midkey);
|
||||||
|
|
||||||
// DELETE the actual directory
|
// DELETE the actual directory
|
||||||
wxString dir=(projFull != wxT("")? projFull: mytemp);
|
wxString dir=(!projFull.empty()? projFull: mytemp);
|
||||||
dir += wxFILE_SEP_PATH;
|
dir += wxFILE_SEP_PATH;
|
||||||
dir += file.Mid(0,3);
|
dir += file.Mid(0,3);
|
||||||
dir += wxFILE_SEP_PATH;
|
dir += wxFILE_SEP_PATH;
|
||||||
@ -1051,7 +1051,7 @@ void DirManager::BalanceInfoDel(const wxString &file)
|
|||||||
if(--dirTopPool[topnum]<1){
|
if(--dirTopPool[topnum]<1){
|
||||||
// do *not* erase the hash entry from dirTopPool
|
// do *not* erase the hash entry from dirTopPool
|
||||||
// *do* DELETE the actual directory
|
// *do* DELETE the actual directory
|
||||||
dir=(projFull != wxT("")? projFull: mytemp);
|
dir=(!projFull.empty()? projFull: mytemp);
|
||||||
dir += wxFILE_SEP_PATH;
|
dir += wxFILE_SEP_PATH;
|
||||||
dir += file.Mid(0,3);
|
dir += file.Mid(0,3);
|
||||||
wxFileName::Rmdir(dir);
|
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
|
wxArrayString filePathArray; // *all* files in the project directory/subdirectories
|
||||||
wxString dirPath = (projFull != wxT("") ? projFull : mytemp);
|
wxString dirPath = (!projFull.empty() ? projFull : mytemp);
|
||||||
RecursivelyEnumerateWithProgress(
|
RecursivelyEnumerateWithProgress(
|
||||||
dirPath,
|
dirPath,
|
||||||
filePathArray, // output: all files in project directory tree
|
filePathArray, // output: all files in project directory tree
|
||||||
@ -2151,7 +2151,7 @@ void DirManager::FindOrphanBlockFiles(
|
|||||||
void DirManager::RemoveOrphanBlockfiles()
|
void DirManager::RemoveOrphanBlockfiles()
|
||||||
{
|
{
|
||||||
wxArrayString filePathArray; // *all* files in the project directory/subdirectories
|
wxArrayString filePathArray; // *all* files in the project directory/subdirectories
|
||||||
wxString dirPath = (projFull != wxT("") ? projFull : mytemp);
|
wxString dirPath = (!projFull.empty() ? projFull : mytemp);
|
||||||
RecursivelyEnumerateWithProgress(
|
RecursivelyEnumerateWithProgress(
|
||||||
dirPath,
|
dirPath,
|
||||||
filePathArray, // output: all files in project directory tree
|
filePathArray, // output: all files in project directory tree
|
||||||
|
@ -1053,7 +1053,7 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
_("Export Spectral Data As:"),
|
_("Export Spectral Data As:"),
|
||||||
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
|
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTextFile f(fName);
|
wxTextFile f(fName);
|
||||||
|
@ -630,7 +630,7 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event))
|
|||||||
this); // Parent
|
this); // Parent
|
||||||
|
|
||||||
// They gave us one...
|
// They gave us one...
|
||||||
if (fileName != wxT("")) {
|
if (!fileName.empty()) {
|
||||||
wxTextFile f;
|
wxTextFile f;
|
||||||
|
|
||||||
// Get at the data
|
// Get at the data
|
||||||
@ -678,7 +678,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Move existing files out of the way. Otherwise wxTextFile will
|
// Move existing files out of the way. Otherwise wxTextFile will
|
||||||
|
@ -286,7 +286,7 @@ void LabelTrack::RestoreFlags( const Flags& flags )
|
|||||||
wxFont LabelTrack::GetFont(const wxString &faceName, int size)
|
wxFont LabelTrack::GetFont(const wxString &faceName, int size)
|
||||||
{
|
{
|
||||||
wxFontEncoding encoding;
|
wxFontEncoding encoding;
|
||||||
if (faceName == wxT(""))
|
if (faceName.empty())
|
||||||
encoding = wxFONTENCODING_DEFAULT;
|
encoding = wxFONTENCODING_DEFAULT;
|
||||||
else
|
else
|
||||||
encoding = wxFONTENCODING_SYSTEM;
|
encoding = wxFONTENCODING_SYSTEM;
|
||||||
|
@ -241,10 +241,10 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames)
|
|||||||
if (fullCode.length() < 2)
|
if (fullCode.length() < 2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (localLanguageName[code] != wxT("")) {
|
if (!localLanguageName[code].empty()) {
|
||||||
name = localLanguageName[code];
|
name = localLanguageName[code];
|
||||||
}
|
}
|
||||||
if (localLanguageName[fullCode] != wxT("")) {
|
if (!localLanguageName[fullCode].empty()) {
|
||||||
name = localLanguageName[fullCode];
|
name = localLanguageName[fullCode];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames)
|
|||||||
code = fullCode;
|
code = fullCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempHash[code] != wxT(""))
|
if (!tempHash[code].empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (TranslationExists(audacityPathList, code) || code==wxT("en")) {
|
if (TranslationExists(audacityPathList, code) || code==wxT("en")) {
|
||||||
|
@ -220,7 +220,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
|||||||
|
|
||||||
// Code from LoadLadspa that might be useful in load modules.
|
// Code from LoadLadspa that might be useful in load modules.
|
||||||
pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH"));
|
pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH"));
|
||||||
if (pathVar != wxT(""))
|
if (!pathVar.empty())
|
||||||
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
||||||
|
|
||||||
for (i = 0; i < audacityPathList.size(); i++) {
|
for (i = 0; i < audacityPathList.size(); i++) {
|
||||||
@ -355,7 +355,7 @@ bool ModuleManager::DiscoverProviders()
|
|||||||
// Code from LoadLadspa that might be useful in load modules.
|
// Code from LoadLadspa that might be useful in load modules.
|
||||||
wxString pathVar = wxString::FromUTF8(getenv("AUDACITY_MODULES_PATH"));
|
wxString pathVar = wxString::FromUTF8(getenv("AUDACITY_MODULES_PATH"));
|
||||||
|
|
||||||
if (pathVar != wxT(""))
|
if (!pathVar.empty())
|
||||||
{
|
{
|
||||||
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
||||||
}
|
}
|
||||||
|
@ -3898,7 +3898,7 @@ bool AudacityProject::DoSave (const bool fromSaveAs,
|
|||||||
wxString project, projName, projPath;
|
wxString project, projName, projPath;
|
||||||
|
|
||||||
auto cleanup = finally( [&] {
|
auto cleanup = finally( [&] {
|
||||||
if (safetyFileName != wxT("")) {
|
if (!safetyFileName.empty()) {
|
||||||
if (wxFileExists(mFileName))
|
if (wxFileExists(mFileName))
|
||||||
wxRemove(mFileName);
|
wxRemove(mFileName);
|
||||||
wxRename(safetyFileName, 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
|
// 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
|
// the .bak file (because it now does not fit our block files anymore
|
||||||
// anyway).
|
// anyway).
|
||||||
if (safetyFileName != wxT(""))
|
if (!safetyFileName.empty())
|
||||||
wxRemoveFile(safetyFileName),
|
wxRemoveFile(safetyFileName),
|
||||||
// cancel the cleanup:
|
// cancel the cleanup:
|
||||||
safetyFileName = wxT("");
|
safetyFileName = wxT("");
|
||||||
@ -4495,7 +4495,7 @@ For an audio file that will open in other apps, use 'Export'.\n");
|
|||||||
wxFD_SAVE | wxRESIZE_BORDER,
|
wxFD_SAVE | wxRESIZE_BORDER,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
filename = fName;
|
filename = fName;
|
||||||
@ -5395,7 +5395,7 @@ bool AudacityProject::IsProjectSaved() {
|
|||||||
// Otherwise it becomes true only when a project is first saved successfully
|
// Otherwise it becomes true only when a project is first saved successfully
|
||||||
// in DirManager::SetProject
|
// in DirManager::SetProject
|
||||||
wxString sProjectName = mDirManager->GetProjectName();
|
wxString sProjectName = mDirManager->GetProjectName();
|
||||||
return (sProjectName != wxT(""));
|
return (!sProjectName.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is done to empty out the tracks, but without creating a new project.
|
// This is done to empty out the tracks, but without creating a new project.
|
||||||
|
@ -541,7 +541,7 @@ void ScreenFrame::OnDirChoose(wxCommandEvent & WXUNUSED(event))
|
|||||||
current);
|
current);
|
||||||
|
|
||||||
dlog.ShowModal();
|
dlog.ShowModal();
|
||||||
if (dlog.GetPath() != wxT("")) {
|
if (!dlog.GetPath().empty()) {
|
||||||
wxFileName tmpDirPath;
|
wxFileName tmpDirPath;
|
||||||
tmpDirPath.AssignDir(dlog.GetPath());
|
tmpDirPath.AssignDir(dlog.GetPath());
|
||||||
wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
|
wxString path = tmpDirPath.GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR);
|
||||||
|
@ -312,7 +312,7 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even
|
|||||||
wxFD_SAVE | wxRESIZE_BORDER,
|
wxFD_SAVE | wxRESIZE_BORDER,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AudacityProject* pProject = GetActiveProject();
|
AudacityProject* pProject = GetActiveProject();
|
||||||
|
@ -45,7 +45,7 @@ bool BatchEvalCommand::Apply(const CommandContext & context)
|
|||||||
MacroCommandsCatalog catalog(&context.project);
|
MacroCommandsCatalog catalog(&context.project);
|
||||||
|
|
||||||
wxString macroName = GetString(wxT("MacroName"));
|
wxString macroName = GetString(wxT("MacroName"));
|
||||||
if (macroName != wxT(""))
|
if (!macroName.empty())
|
||||||
{
|
{
|
||||||
MacroCommands batch;
|
MacroCommands batch;
|
||||||
batch.ReadMacro(macroName);
|
batch.ReadMacro(macroName);
|
||||||
|
@ -769,7 +769,7 @@ void CommandManager::AddItem(const wxChar *name,
|
|||||||
|
|
||||||
wxString cookedParameter;
|
wxString cookedParameter;
|
||||||
const auto ¶meter = options.parameter;
|
const auto ¶meter = options.parameter;
|
||||||
if( parameter == "" )
|
if( parameter.empty() )
|
||||||
cookedParameter = name;
|
cookedParameter = name;
|
||||||
else
|
else
|
||||||
cookedParameter = parameter;
|
cookedParameter = parameter;
|
||||||
|
@ -786,7 +786,7 @@ wxRect ScreenshotCommand::GetTrackRect( AudacityProject * pProj, TrackPanel * pa
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxString ScreenshotCommand::WindowFileName(AudacityProject * proj, wxTopLevelWindow *w){
|
wxString ScreenshotCommand::WindowFileName(AudacityProject * proj, wxTopLevelWindow *w){
|
||||||
if (w != proj && w->GetTitle() != wxT("")) {
|
if (w != proj && !w->GetTitle().empty()) {
|
||||||
mFileName = MakeFileName(mFilePath,
|
mFileName = MakeFileName(mFilePath,
|
||||||
kCaptureWhatStrings[ mCaptureMode ].Translation() +
|
kCaptureWhatStrings[ mCaptureMode ].Translation() +
|
||||||
(wxT("-") + w->GetTitle() + wxT("-")));
|
(wxT("-") + w->GetTitle() + wxT("-")));
|
||||||
|
@ -505,7 +505,7 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
wxFD_SAVE | wxRESIZE_BORDER,
|
wxFD_SAVE | wxRESIZE_BORDER,
|
||||||
this);
|
this);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxTextFile f(fName);
|
wxTextFile f(fName);
|
||||||
|
@ -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.
|
// MJS: I don't know what the above means, or if I have broken it.
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
|
|
||||||
if(fileName == wxT("")) {
|
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 = wxT("");
|
||||||
@ -1568,7 +1568,7 @@ bool EffectEqualization::GetDefaultFileName(wxFileName &fileName)
|
|||||||
void EffectEqualization::SaveCurves(const wxString &fileName)
|
void EffectEqualization::SaveCurves(const wxString &fileName)
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
if( fileName == wxT(""))
|
if( fileName.empty() )
|
||||||
{
|
{
|
||||||
// Construct default curve filename
|
// 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;
|
bad = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ bool ExportPlugin::IsExtension(const wxString & ext, int index)
|
|||||||
wxString defext = GetExtension(i);
|
wxString defext = GetExtension(i);
|
||||||
auto defexts = GetExtensions(i);
|
auto defexts = GetExtensions(i);
|
||||||
int indofext = defexts.Index(ext, false);
|
int indofext = defexts.Index(ext, false);
|
||||||
if (defext == wxT("") || (indofext != wxNOT_FOUND))
|
if (defext.empty() || (indofext != wxNOT_FOUND))
|
||||||
isext = true;
|
isext = true;
|
||||||
}
|
}
|
||||||
return isext;
|
return isext;
|
||||||
|
@ -391,12 +391,12 @@ void ExportMultiple::EnableControls()
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
if (mLabel->GetValue() && mFirst->GetValue() &&
|
if (mLabel->GetValue() && mFirst->GetValue() &&
|
||||||
mFirstFileName->GetValue() == wxT("") &&
|
mFirstFileName->GetValue().empty() &&
|
||||||
mPrefix->GetValue() == wxT(""))
|
mPrefix->GetValue().empty())
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
if (mByNumber->GetValue() &&
|
if (mByNumber->GetValue() &&
|
||||||
mPrefix->GetValue() == wxT(""))
|
mPrefix->GetValue().empty())
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
||||||
mExport->Enable(ok);
|
mExport->Enable(ok);
|
||||||
@ -458,7 +458,7 @@ void ExportMultiple::OnChoose(wxCommandEvent& WXUNUSED(event))
|
|||||||
_("Choose a location to save the exported files"),
|
_("Choose a location to save the exported files"),
|
||||||
mDir->GetValue());
|
mDir->GetValue());
|
||||||
dlog.ShowModal();
|
dlog.ShowModal();
|
||||||
if (dlog.GetPath() != wxT(""))
|
if (!dlog.GetPath().empty())
|
||||||
mDir->SetValue(dlog.GetPath());
|
mDir->SetValue(dlog.GetPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ void OnExportLabels(const CommandContext &context)
|
|||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||||
&project);
|
&project);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Move existing files out of the way. Otherwise wxTextFile will
|
// 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,
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
|
||||||
&project);
|
&project);
|
||||||
|
|
||||||
if (fName == wxT(""))
|
if (fName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!fName.Contains(wxT("."))) {
|
if(!fName.Contains(wxT("."))) {
|
||||||
@ -445,7 +445,7 @@ void OnImportLabels(const CommandContext &context)
|
|||||||
wxRESIZE_BORDER, // Flags
|
wxRESIZE_BORDER, // Flags
|
||||||
&project); // Parent
|
&project); // Parent
|
||||||
|
|
||||||
if (fileName != wxT("")) {
|
if (!fileName.empty()) {
|
||||||
wxTextFile f;
|
wxTextFile f;
|
||||||
|
|
||||||
f.Open(fileName);
|
f.Open(fileName);
|
||||||
@ -487,7 +487,7 @@ void OnImportMIDI(const CommandContext &context)
|
|||||||
wxRESIZE_BORDER, // Flags
|
wxRESIZE_BORDER, // Flags
|
||||||
&project); // Parent
|
&project); // Parent
|
||||||
|
|
||||||
if (fileName != wxT(""))
|
if (!fileName.empty())
|
||||||
DoImportMIDI(&project, fileName);
|
DoImportMIDI(&project, fileName);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -507,7 +507,7 @@ void OnImportRaw(const CommandContext &context)
|
|||||||
wxRESIZE_BORDER, // Flags
|
wxRESIZE_BORDER, // Flags
|
||||||
&project); // Parent
|
&project); // Parent
|
||||||
|
|
||||||
if (fileName == wxT(""))
|
if (fileName.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TrackHolders newTracks;
|
TrackHolders newTracks;
|
||||||
|
@ -236,7 +236,7 @@ void DevicePrefs::OnHost(wxCommandEvent & e)
|
|||||||
wxString recDevice;
|
wxString recDevice;
|
||||||
|
|
||||||
recDevice = mRecordDevice;
|
recDevice = mRecordDevice;
|
||||||
if (this->mRecordSource != wxT(""))
|
if (!this->mRecordSource.empty())
|
||||||
recDevice += wxT(": ") + mRecordSource;
|
recDevice += wxT(": ") + mRecordSource;
|
||||||
|
|
||||||
mRecord->Clear();
|
mRecord->Clear();
|
||||||
|
@ -145,7 +145,7 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e)
|
|||||||
_("Choose a location to place the temporary directory"),
|
_("Choose a location to place the temporary directory"),
|
||||||
oldTempDir );
|
oldTempDir );
|
||||||
int retval = dlog.ShowModal();
|
int retval = dlog.ShowModal();
|
||||||
if (retval != wxID_CANCEL && dlog.GetPath() != wxT("")) {
|
if (retval != wxID_CANCEL && !dlog.GetPath().empty()) {
|
||||||
wxFileName tmpDirPath;
|
wxFileName tmpDirPath;
|
||||||
tmpDirPath.AssignDir(dlog.GetPath());
|
tmpDirPath.AssignDir(dlog.GetPath());
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ void DeviceToolBar::UpdatePrefs()
|
|||||||
|
|
||||||
devName = gPrefs->Read(wxT("/AudioIO/RecordingDevice"), wxT(""));
|
devName = gPrefs->Read(wxT("/AudioIO/RecordingDevice"), wxT(""));
|
||||||
sourceName = gPrefs->Read(wxT("/AudioIO/RecordingSource"), wxT(""));
|
sourceName = gPrefs->Read(wxT("/AudioIO/RecordingSource"), wxT(""));
|
||||||
if (sourceName == wxT(""))
|
if (sourceName.empty())
|
||||||
desc = devName;
|
desc = devName;
|
||||||
else
|
else
|
||||||
desc = devName + wxT(": ") + sourceName;
|
desc = devName + wxT(": ") + sourceName;
|
||||||
@ -270,7 +270,7 @@ void DeviceToolBar::UpdatePrefs()
|
|||||||
|
|
||||||
devName = gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), wxT(""));
|
devName = gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), wxT(""));
|
||||||
sourceName = gPrefs->Read(wxT("/AudioIO/PlaybackSource"), wxT(""));
|
sourceName = gPrefs->Read(wxT("/AudioIO/PlaybackSource"), wxT(""));
|
||||||
if (sourceName == wxT(""))
|
if (sourceName.empty())
|
||||||
desc = devName;
|
desc = devName;
|
||||||
else
|
else
|
||||||
desc = devName + wxT(": ") + sourceName;
|
desc = devName + wxT(": ") + sourceName;
|
||||||
@ -304,7 +304,7 @@ void DeviceToolBar::UpdatePrefs()
|
|||||||
if (newChannels > 0 && oldChannels != newChannels)
|
if (newChannels > 0 && oldChannels != newChannels)
|
||||||
mInputChannels->SetSelection(newChannels - 1);
|
mInputChannels->SetSelection(newChannels - 1);
|
||||||
|
|
||||||
if (hostName != wxT("") && mHost->GetStringSelection() != hostName)
|
if (!hostName.empty() && mHost->GetStringSelection() != hostName)
|
||||||
mHost->SetStringSelection(hostName);
|
mHost->SetStringSelection(hostName);
|
||||||
|
|
||||||
RegenerateTooltips();
|
RegenerateTooltips();
|
||||||
@ -577,7 +577,7 @@ void DeviceToolBar::FillHostDevices()
|
|||||||
for (i = 0; i < inMaps.size(); i++) {
|
for (i = 0; i < inMaps.size(); i++) {
|
||||||
if (foundHostIndex == inMaps[i].hostIndex) {
|
if (foundHostIndex == inMaps[i].hostIndex) {
|
||||||
mInput->Append(MakeDeviceSourceString(&inMaps[i]));
|
mInput->Append(MakeDeviceSourceString(&inMaps[i]));
|
||||||
if (host == wxT("")) {
|
if (host.empty()) {
|
||||||
host = inMaps[i].hostString;
|
host = inMaps[i].hostString;
|
||||||
gPrefs->Write(wxT("/AudioIO/Host"), host);
|
gPrefs->Write(wxT("/AudioIO/Host"), host);
|
||||||
mHost->SetStringSelection(host);
|
mHost->SetStringSelection(host);
|
||||||
@ -592,7 +592,7 @@ void DeviceToolBar::FillHostDevices()
|
|||||||
for (i = 0; i < outMaps.size(); i++) {
|
for (i = 0; i < outMaps.size(); i++) {
|
||||||
if (foundHostIndex == outMaps[i].hostIndex) {
|
if (foundHostIndex == outMaps[i].hostIndex) {
|
||||||
mOutput->Append(MakeDeviceSourceString(&outMaps[i]));
|
mOutput->Append(MakeDeviceSourceString(&outMaps[i]));
|
||||||
if (host == wxT("")) {
|
if (host.empty()) {
|
||||||
host = outMaps[i].hostString;
|
host = outMaps[i].hostString;
|
||||||
gPrefs->Write(wxT("/AudioIO/Host"), host);
|
gPrefs->Write(wxT("/AudioIO/Host"), host);
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
|
@ -970,7 +970,7 @@ HitTestPreview SelectHandle::Preview
|
|||||||
|
|
||||||
MaySetOnDemandTip(pTrack.get(), tip);
|
MaySetOnDemandTip(pTrack.get(), tip);
|
||||||
}
|
}
|
||||||
if (tip == "") {
|
if (tip.empty()) {
|
||||||
tip = _("Click and drag to select audio");
|
tip = _("Click and drag to select audio");
|
||||||
}
|
}
|
||||||
if (HasEscape() && mUseSnap) {
|
if (HasEscape() && mUseSnap) {
|
||||||
|
@ -90,7 +90,7 @@ ErrorDialog::ErrorDialog(
|
|||||||
long buttonMask;
|
long buttonMask;
|
||||||
|
|
||||||
// only add the help button if we have a URL
|
// only add the help button if we have a URL
|
||||||
buttonMask = (helpPage == wxT("")) ? eOkButton : (eHelpButton | eOkButton);
|
buttonMask = (helpPage.empty()) ? eOkButton : (eHelpButton | eOkButton);
|
||||||
dhelpPage = helpPage;
|
dhelpPage = helpPage;
|
||||||
dClose = Close;
|
dClose = Close;
|
||||||
dModal = modal;
|
dModal = modal;
|
||||||
|
@ -658,27 +658,27 @@ void NumericConverter::ParseFormatString( const wxString & untranslatedFormat)
|
|||||||
else
|
else
|
||||||
remainder.ToDouble(&mScalingFactor);
|
remainder.ToDouble(&mScalingFactor);
|
||||||
i = format.length()-1; // force break out of loop
|
i = format.length()-1; // force break out of loop
|
||||||
if (delimStr != wxT(""))
|
if (!delimStr.empty())
|
||||||
handleDelim = true;
|
handleDelim = true;
|
||||||
if (numStr != wxT(""))
|
if (!numStr.empty())
|
||||||
handleNum = true;
|
handleNum = true;
|
||||||
}
|
}
|
||||||
else if ((format[i] >= '0' && format[i] <='9') ||
|
else if ((format[i] >= '0' && format[i] <='9') ||
|
||||||
format[i] == wxT('*') || format[i] == wxT('#')) {
|
format[i] == wxT('*') || format[i] == wxT('#')) {
|
||||||
numStr += format[i];
|
numStr += format[i];
|
||||||
if (delimStr != wxT(""))
|
if (!delimStr.empty())
|
||||||
handleDelim = true;
|
handleDelim = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
delimStr += format[i];
|
delimStr += format[i];
|
||||||
if (numStr != wxT(""))
|
if (!numStr.empty())
|
||||||
handleNum = true;
|
handleNum = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == format.length() - 1) {
|
if (i == format.length() - 1) {
|
||||||
if (numStr != wxT(""))
|
if (!numStr.empty())
|
||||||
handleNum = true;
|
handleNum = true;
|
||||||
if (delimStr != wxT(""))
|
if (!delimStr.empty())
|
||||||
handleDelim = true;
|
handleDelim = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,7 +715,7 @@ wxString Ruler::LabelString(double d, bool major)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mUnits != wxT(""))
|
if (!mUnits.empty())
|
||||||
s = (s + mUnits);
|
s = (s + mUnits);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
@ -1393,7 +1393,7 @@ void Ruler::Draw(wxDC& dc, const TimeTrack* timetrack)
|
|||||||
mDC->SetFont(*mMinorMinorFont);
|
mDC->SetFont(*mMinorMinorFont);
|
||||||
|
|
||||||
for(i=0; i<mNumMinorMinor; i++) {
|
for(i=0; i<mNumMinorMinor; i++) {
|
||||||
if (mMinorMinorLabels[i].text != wxT(""))
|
if (!mMinorMinorLabels[i].text.empty())
|
||||||
{
|
{
|
||||||
int pos = mMinorMinorLabels[i].pos;
|
int pos = mMinorMinorLabels[i].pos;
|
||||||
|
|
||||||
@ -1552,7 +1552,7 @@ void Ruler::SetCustomMinorLabels(wxArrayString *label, size_t numLabel, int star
|
|||||||
|
|
||||||
void Ruler::Label::Draw(wxDC&dc, bool twoTone, wxColour c) const
|
void Ruler::Label::Draw(wxDC&dc, bool twoTone, wxColour c) const
|
||||||
{
|
{
|
||||||
if (text != wxT("")) {
|
if (!text.empty()) {
|
||||||
bool altColor = twoTone && value < 0.0;
|
bool altColor = twoTone && value < 0.0;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
|
Loading…
x
Reference in New Issue
Block a user