mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
Merge the log window CreateGUIControls and LoadSettings methods. This allows the settings from the ini file to be applied when the controls are created rather than setting a default, and then changing the settings later. In particular word wrap is applied when the text control is created. This works around the crash at application start that users are reporting in issue 4196.
Also change the for loops in SysConf to use iterators to placate godisgovernment and billiard. :P git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7283 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -93,19 +93,19 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t index = 0;
|
||||
for (; index < m_Entries.size() - 1; index++)
|
||||
std::vector<SSysConfEntry>::iterator index = m_Entries.begin();
|
||||
for (; index < m_Entries.end() - 1; index++)
|
||||
{
|
||||
if (strcmp(m_Entries[index].name, sectionName) == 0)
|
||||
if (strcmp(index->name, sectionName) == 0)
|
||||
break;
|
||||
}
|
||||
if (index == m_Entries.size() - 1)
|
||||
if (index == m_Entries.end() - 1)
|
||||
{
|
||||
PanicAlertT("Section %s not found in SYSCONF", sectionName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_Entries[index].GetData<T>();
|
||||
return index->GetData<T>();
|
||||
}
|
||||
|
||||
bool GetArrayData(const char* sectionName, u8* dest, u16 destSize)
|
||||
@ -116,19 +116,19 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t index = 0;
|
||||
for (; index < m_Entries.size() - 1; index++)
|
||||
std::vector<SSysConfEntry>::iterator index = m_Entries.begin();
|
||||
for (; index < m_Entries.end() - 1; index++)
|
||||
{
|
||||
if (strcmp(m_Entries[index].name, sectionName) == 0)
|
||||
if (strcmp(index->name, sectionName) == 0)
|
||||
break;
|
||||
}
|
||||
if (index == m_Entries.size() - 1)
|
||||
if (index == m_Entries.end() - 1)
|
||||
{
|
||||
PanicAlertT("Section %s not found in SYSCONF", sectionName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_Entries[index].GetArrayData(dest, destSize);
|
||||
return index->GetArrayData(dest, destSize);
|
||||
}
|
||||
|
||||
bool SetArrayData(const char* sectionName, u8* buffer, u16 bufferSize)
|
||||
@ -136,19 +136,19 @@ public:
|
||||
if (!m_IsValid)
|
||||
return false;
|
||||
|
||||
size_t index = 0;
|
||||
for (; index < m_Entries.size() - 1; index++)
|
||||
std::vector<SSysConfEntry>::iterator index = m_Entries.begin();
|
||||
for (; index < m_Entries.end() - 1; index++)
|
||||
{
|
||||
if (strcmp(m_Entries[index].name, sectionName) == 0)
|
||||
if (strcmp(index->name, sectionName) == 0)
|
||||
break;
|
||||
}
|
||||
if (index == m_Entries.size() - 1)
|
||||
if (index == m_Entries.end() - 1)
|
||||
{
|
||||
PanicAlertT("Section %s not found in SYSCONF", sectionName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return m_Entries[index].SetArrayData(buffer, bufferSize);
|
||||
return index->SetArrayData(buffer, bufferSize);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@ -157,19 +157,19 @@ public:
|
||||
if (!m_IsValid)
|
||||
return false;
|
||||
|
||||
size_t index = 0;
|
||||
for (; index < m_Entries.size() - 1; index++)
|
||||
std::vector<SSysConfEntry>::iterator index = m_Entries.begin();
|
||||
for (; index < m_Entries.end() - 1; index++)
|
||||
{
|
||||
if (strcmp(m_Entries[index].name, sectionName) == 0)
|
||||
if (strcmp(index->name, sectionName) == 0)
|
||||
break;
|
||||
}
|
||||
if (index == m_Entries.size() - 1)
|
||||
if (index == m_Entries.end() - 1)
|
||||
{
|
||||
PanicAlertT("Section %s not found in SYSCONF", sectionName);
|
||||
return false;
|
||||
}
|
||||
|
||||
*(T*)m_Entries[index].data = newValue;
|
||||
*(T*)index->data = newValue;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user