mirror of https://github.com/stella-emu/stella.git
And yet more 'enum' cleanups.
This commit is contained in:
parent
4d99772a10
commit
d54f106a3a
|
@ -68,11 +68,7 @@ class FilesystemNode
|
|||
/**
|
||||
* Flag to tell listDir() which kind of files to list.
|
||||
*/
|
||||
enum ListMode {
|
||||
kListFilesOnly = 1,
|
||||
kListDirectoriesOnly = 2,
|
||||
kListAll = 3
|
||||
};
|
||||
enum class ListMode { FilesOnly, DirectoriesOnly, All };
|
||||
|
||||
/**
|
||||
* Create a new pathless FilesystemNode. Since there's no path associated
|
||||
|
@ -143,7 +139,7 @@ class FilesystemNode
|
|||
* @return true if successful, false otherwise (e.g. when the directory
|
||||
* does not exist).
|
||||
*/
|
||||
bool getChildren(FSList& fslist, ListMode mode = kListDirectoriesOnly,
|
||||
bool getChildren(FSList& fslist, ListMode mode = ListMode::DirectoriesOnly,
|
||||
bool hidden = false) const;
|
||||
|
||||
/**
|
||||
|
|
|
@ -211,10 +211,7 @@ class Serializer
|
|||
// The stream to send the serialized data to.
|
||||
unique_ptr<iostream> myStream;
|
||||
|
||||
enum {
|
||||
TruePattern = 0xfe,
|
||||
FalsePattern = 0x01
|
||||
};
|
||||
static constexpr uInt8 TruePattern = 0xfe, FalsePattern = 0x01;
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
|
@ -114,7 +114,7 @@ void BrowserDialog::show(const string& startpath,
|
|||
switch(_mode)
|
||||
{
|
||||
case FileLoad:
|
||||
_fileList->setFileListMode(FilesystemNode::kListAll);
|
||||
_fileList->setFileListMode(FilesystemNode::ListMode::All);
|
||||
_fileList->setFileExtension(ext);
|
||||
_selected->setEditable(false);
|
||||
_selected->clearFlags(WIDGET_INVISIBLE);
|
||||
|
@ -122,7 +122,7 @@ void BrowserDialog::show(const string& startpath,
|
|||
break;
|
||||
|
||||
case FileSave:
|
||||
_fileList->setFileListMode(FilesystemNode::kListAll);
|
||||
_fileList->setFileListMode(FilesystemNode::ListMode::All);
|
||||
_fileList->setFileExtension(ext);
|
||||
_selected->setEditable(false); // FIXME - disable user input for now
|
||||
_selected->clearFlags(WIDGET_INVISIBLE);
|
||||
|
@ -130,7 +130,7 @@ void BrowserDialog::show(const string& startpath,
|
|||
break;
|
||||
|
||||
case Directories:
|
||||
_fileList->setFileListMode(FilesystemNode::kListDirectoriesOnly);
|
||||
_fileList->setFileListMode(FilesystemNode::ListMode::DirectoriesOnly);
|
||||
_selected->setEditable(false);
|
||||
_selected->setFlags(WIDGET_INVISIBLE);
|
||||
_type->setFlags(WIDGET_INVISIBLE);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, int w, int h)
|
||||
: StringListWidget(boss, font, x, y, w, h),
|
||||
_fsmode(FilesystemNode::kListAll),
|
||||
_fsmode(FilesystemNode::ListMode::All),
|
||||
_extension("")
|
||||
{
|
||||
// This widget is special, in that it catches signals and redirects them
|
||||
|
|
|
@ -340,7 +340,7 @@ void LauncherDialog::loadDirListing()
|
|||
|
||||
FSList files;
|
||||
files.reserve(2048);
|
||||
myCurrentNode.getChildren(files, FilesystemNode::kListAll);
|
||||
myCurrentNode.getChildren(files, FilesystemNode::ListMode::All);
|
||||
|
||||
// Add '[..]' to indicate previous folder
|
||||
if(myCurrentNode.hasParent())
|
||||
|
|
|
@ -121,7 +121,7 @@ void RomAuditDialog::auditRoms()
|
|||
FilesystemNode node(auditPath);
|
||||
FSList files;
|
||||
files.reserve(2048);
|
||||
node.getChildren(files, FilesystemNode::kListFilesOnly);
|
||||
node.getChildren(files, FilesystemNode::ListMode::FilesOnly);
|
||||
|
||||
// Create a progress dialog box to show the progress of processing
|
||||
// the ROMs, since this is usually a time-consuming operation
|
||||
|
|
|
@ -174,8 +174,8 @@ bool FilesystemNodePOSIX::getChildren(AbstractFSList& myList, ListMode mode,
|
|||
continue;
|
||||
|
||||
// Honor the chosen mode
|
||||
if ((mode == FilesystemNode::kListFilesOnly && !entry._isFile) ||
|
||||
(mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
|
||||
if ((mode == FilesystemNode::ListMode::FilesOnly && !entry._isFile) ||
|
||||
(mode == FilesystemNode::ListMode::DirectoriesOnly && !entry._isDirectory))
|
||||
continue;
|
||||
|
||||
myList.emplace_back(new FilesystemNodePOSIX(entry));
|
||||
|
|
|
@ -134,8 +134,8 @@ void FilesystemNodeWINDOWS::addFile(AbstractFSList& list, ListMode mode,
|
|||
isDirectory = ((find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false);
|
||||
isFile = !isDirectory;//(find_data->dwFileAttributes & FILE_ATTRIBUTE_NORMAL ? true : false);
|
||||
|
||||
if((isFile && mode == FilesystemNode::kListDirectoriesOnly) ||
|
||||
(isDirectory && mode == FilesystemNode::kListFilesOnly))
|
||||
if((isFile && mode == FilesystemNode::ListMode::DirectoriesOnly) ||
|
||||
(isDirectory && mode == FilesystemNode::ListMode::FilesOnly))
|
||||
return;
|
||||
|
||||
entry._isDirectory = isDirectory;
|
||||
|
|
Loading…
Reference in New Issue