summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/inifile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui/inifile.cpp')
-rw-r--r--src/emu/ui/inifile.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/emu/ui/inifile.cpp b/src/emu/ui/inifile.cpp
index 8958fe4cd3b..33bd433a7f7 100644
--- a/src/emu/ui/inifile.cpp
+++ b/src/emu/ui/inifile.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Dankan1890
+// copyright-holders:Maurizio Petrarota
/***************************************************************************
ui/inifile.cpp
@@ -18,8 +18,8 @@
//-------------------------------------------------
// GLOBAL VARIABLES
//-------------------------------------------------
-UINT16 inifile_manager::current_category = 0;
-UINT16 inifile_manager::current_file = 0;
+UINT16 inifile_manager::c_cat = 0;
+UINT16 inifile_manager::c_file = 0;
//-------------------------------------------------
// ctor
@@ -48,10 +48,6 @@ void inifile_manager::directory_scan()
int length = strlen(dir->name);
std::string filename(dir->name);
- // skip ui_favorite file
- if (!core_stricmp("ui_favorite.ini", filename.c_str()))
- continue;
-
// check .ini file ending
if ((length > 4) && dir->name[length - 4] == '.' && tolower((UINT8)dir->name[length - 3]) == 'i' &&
tolower((UINT8)dir->name[length - 2]) == 'n' && tolower((UINT8)dir->name[length - 1]) == 'i')
@@ -103,8 +99,8 @@ void inifile_manager::load_ini_category(std::vector<int> &temp_filter)
return;
bool search_clones = false;
- std::string filename(ini_index[current_file].name);
- long offset = ini_index[current_file].category[current_category].offset;
+ std::string filename(ini_index[c_file].first);
+ long offset = ini_index[c_file].second[c_cat].second;
if (!core_stricmp(filename.c_str(), "category.ini") || !core_stricmp(filename.c_str(), "alltime.ini"))
search_clones = true;
@@ -151,7 +147,7 @@ bool inifile_manager::parseopen(const char *filename)
// so it's better and faster use standard C fileio functions.
emu_file file(machine().ui().options().extraini_path(), OPEN_FLAG_READ);
- if (file.open(filename) != FILERR_NONE)
+ if (file.open(filename) != osd_file::error::NONE)
return false;
m_fullpath = file.fullpath();
@@ -359,7 +355,7 @@ bool favorite_manager::isgame_favorite(ui_software_info &swinfo)
void favorite_manager::parse_favorite()
{
emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_READ);
- if (file.open(favorite_filename) == FILERR_NONE)
+ if (file.open(favorite_filename) == osd_file::error::NONE)
{
char readbuf[1024];
file.gets(readbuf, 1024);
@@ -418,7 +414,7 @@ void favorite_manager::save_favorite_games()
{
// attempt to open the output file
emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- if (file.open(favorite_filename) == FILERR_NONE)
+ if (file.open(favorite_filename) == osd_file::error::NONE)
{
if (m_list.empty())
{