code cleanup

This commit is contained in:
penfold42 2018-07-23 09:06:11 +10:00
parent 1039cca757
commit ea071f0b46
2 changed files with 10 additions and 15 deletions

View file

@ -1100,9 +1100,6 @@ void IEC_Commands::New(void)
{ {
FILINFO filInfo; FILINFO filInfo;
if(!(strstr(filenameNew, ".d64") || strstr(filenameNew, ".D64")))
strcat(filenameNew, ".d64");
int ret = CreateD64(filenameNew, ID, true); int ret = CreateD64(filenameNew, ID, true);
if (ret==0) if (ret==0)

View file

@ -737,17 +737,14 @@ void emulator()
CheckAutoMountImage(EXIT_UNKNOWN, fileBrowser); CheckAutoMountImage(EXIT_UNKNOWN, fileBrowser);
break; break;
case IEC_Commands::NONE: case IEC_Commands::NONE:
{
fileBrowser->Update(); fileBrowser->Update();
// Check selections made via FileBrowser // Check selections made via FileBrowser
if (fileBrowser->SelectionsMade()) if (fileBrowser->SelectionsMade())
emulating = BeginEmulating(fileBrowser, fileBrowser->LastSelectionName()); emulating = BeginEmulating(fileBrowser, fileBrowser->LastSelectionName());
}
break; break;
case IEC_Commands::IMAGE_SELECTED: case IEC_Commands::IMAGE_SELECTED:
{ // Check selections made via IEC commands (like fb64)
// Check selections made via FileBrowser
fileBrowserSelectedName = m_IEC_Commands.GetNameOfImageSelected(); fileBrowserSelectedName = m_IEC_Commands.GetNameOfImageSelected();
@ -769,8 +766,10 @@ void emulator()
DEBUG_LOG("IEC mounting %s\r\n", filInfoSelected->fname); DEBUG_LOG("IEC mounting %s\r\n", filInfoSelected->fname);
bool readOnly = (filInfoSelected->fattrib & AM_RDO) != 0; bool readOnly = (filInfoSelected->fattrib & AM_RDO) != 0;
if (diskCaddy.Insert(filInfoSelected, readOnly)) emulating = BeginEmulating(fileBrowser, filInfoSelected->fname); if (diskCaddy.Insert(filInfoSelected, readOnly))
else fileBrowserSelectedName = 0; emulating = BeginEmulating(fileBrowser, filInfoSelected->fname);
else
fileBrowserSelectedName = 0;
} }
else else
{ {
@ -781,7 +780,6 @@ void emulator()
m_IEC_Commands.Reset(); m_IEC_Commands.Reset();
selectedViaIECCommands = true; selectedViaIECCommands = true;
}
break; break;
case IEC_Commands::DIR_PUSHED: case IEC_Commands::DIR_PUSHED:
fileBrowser->FolderChanged(); fileBrowser->FolderChanged();