(svn r2100) - Fix: [1024703]: Infinite access for A:\ (win32). Patch [1171208]. Only requery drive(s) if the user changes a directory, also surpress the OS error box that pops up on some windows machines. Tron + glx (and me)

This commit is contained in:
darkvater
2005-03-28 13:30:51 +00:00
parent 4573a9f872
commit 6bca4c041a
6 changed files with 70 additions and 45 deletions

View File

@@ -20,6 +20,7 @@
#include "hal.h" // for file list
static bool _fios_path_changed;
static bool _savegame_sort_dirty;
bool _query_string_active;
@@ -1126,25 +1127,30 @@ static const Widget _save_dialog_scen_widgets[] = {
void BuildFileList(void)
{
_fios_path_changed = true;
FiosFreeSavegameList();
if(_saveload_mode==SLD_NEW_GAME || _saveload_mode==SLD_LOAD_SCENARIO || _saveload_mode==SLD_SAVE_SCENARIO)
if (_saveload_mode == SLD_NEW_GAME || _saveload_mode == SLD_LOAD_SCENARIO || _saveload_mode == SLD_SAVE_SCENARIO) {
_fios_list = FiosGetScenarioList(&_fios_num, _saveload_mode);
else
} else
_fios_list = FiosGetSavegameList(&_fios_num, _saveload_mode);
}
static void DrawFiosTexts(void)
{
const char *path;
StringID str;
static const char *path = NULL;
static StringID str = STR_4006_UNABLE_TO_READ_DRIVE;
static uint32 tot = 0;
str = FiosGetDescText(&path);
if (str != 0)
DrawString(2, 37, str, 0);
if (_fios_path_changed) {
str = FiosGetDescText(&path, &tot);
_fios_path_changed = false;
}
if (str != STR_4006_UNABLE_TO_READ_DRIVE) SetDParam(0, tot);
DrawString(2, 37, str, 0);
DoDrawString(path, 2, 27, 16);
}
static void MakeSortedSaveGameList(void)
{
/* Directories are always above the files (FIOS_TYPE_DIR)