mirror of https://github.com/OpenTTD/OpenTTD
(svn r27643) -Codechange: FiosGetDrives function also takes a destination file list.
parent
caf3379746
commit
95bb103a23
|
@ -38,7 +38,7 @@ SortingBits _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
|
||||||
extern bool FiosIsRoot(const char *path);
|
extern bool FiosIsRoot(const char *path);
|
||||||
extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
|
extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
|
||||||
extern bool FiosIsHiddenFile(const struct dirent *ent);
|
extern bool FiosIsHiddenFile(const struct dirent *ent);
|
||||||
extern void FiosGetDrives();
|
extern void FiosGetDrives(FileList &file_list);
|
||||||
extern bool FiosGetDiskFreeSpace(const char *path, uint64 *tot);
|
extern bool FiosGetDiskFreeSpace(const char *path, uint64 *tot);
|
||||||
|
|
||||||
/* get the name of an oldstyle savegame */
|
/* get the name of an oldstyle savegame */
|
||||||
|
@ -354,7 +354,7 @@ static void FiosGetFileList(SaveLoadDialogMode mode, fios_getlist_callback_proc
|
||||||
QSortT(file_list.Get(sort_start), file_list.Length() - sort_start, CompareFiosItems);
|
QSortT(file_list.Get(sort_start), file_list.Length() - sort_start, CompareFiosItems);
|
||||||
|
|
||||||
/* Show drives */
|
/* Show drives */
|
||||||
FiosGetDrives();
|
FiosGetDrives(file_list);
|
||||||
|
|
||||||
file_list.Compact();
|
file_list.Compact();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ bool FiosIsRoot(const char *file)
|
||||||
return file[3] == '\0';
|
return file[3] == '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiosGetDrives()
|
void FiosGetDrives(FileList &file_list)
|
||||||
{
|
{
|
||||||
uint disk, disk2, save, total;
|
uint disk, disk2, save, total;
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ void FiosGetDrives()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (disk == disk2) {
|
if (disk == disk2) {
|
||||||
FiosItem *fios = _fios_items.Append();
|
FiosItem *fios = file_list.Append();
|
||||||
fios->type = FIOS_TYPE_DRIVE;
|
fios->type = FIOS_TYPE_DRIVE;
|
||||||
fios->mtime = 0;
|
fios->mtime = 0;
|
||||||
#ifndef __INNOTEK_LIBC__
|
#ifndef __INNOTEK_LIBC__
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "../../core/random_func.hpp"
|
#include "../../core/random_func.hpp"
|
||||||
#include "../../debug.h"
|
#include "../../debug.h"
|
||||||
#include "../../string_func.h"
|
#include "../../string_func.h"
|
||||||
|
#include "../../fios.h"
|
||||||
|
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -77,7 +78,7 @@ bool FiosIsRoot(const char *path)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiosGetDrives()
|
void FiosGetDrives(FileList &file_list)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,11 +208,11 @@ bool FiosIsRoot(const char *file)
|
||||||
return file[3] == '\0'; // C:\...
|
return file[3] == '\0'; // C:\...
|
||||||
}
|
}
|
||||||
|
|
||||||
void FiosGetDrives()
|
void FiosGetDrives(FileList &file_list)
|
||||||
{
|
{
|
||||||
#if defined(WINCE)
|
#if defined(WINCE)
|
||||||
/* WinCE only knows one drive: / */
|
/* WinCE only knows one drive: / */
|
||||||
FiosItem *fios = _fios_items.Append();
|
FiosItem *fios = file_list.Append();
|
||||||
fios->type = FIOS_TYPE_DRIVE;
|
fios->type = FIOS_TYPE_DRIVE;
|
||||||
fios->mtime = 0;
|
fios->mtime = 0;
|
||||||
seprintf(fios->name, lastof(fios->name), PATHSEP "");
|
seprintf(fios->name, lastof(fios->name), PATHSEP "");
|
||||||
|
@ -223,7 +223,7 @@ void FiosGetDrives()
|
||||||
|
|
||||||
GetLogicalDriveStrings(lengthof(drives), drives);
|
GetLogicalDriveStrings(lengthof(drives), drives);
|
||||||
for (s = drives; *s != '\0';) {
|
for (s = drives; *s != '\0';) {
|
||||||
FiosItem *fios = _fios_items.Append();
|
FiosItem *fios = file_list.Append();
|
||||||
fios->type = FIOS_TYPE_DRIVE;
|
fios->type = FIOS_TYPE_DRIVE;
|
||||||
fios->mtime = 0;
|
fios->mtime = 0;
|
||||||
seprintf(fios->name, lastof(fios->name), "%c:", s[0] & 0xFF);
|
seprintf(fios->name, lastof(fios->name), "%c:", s[0] & 0xFF);
|
||||||
|
|
Loading…
Reference in New Issue