mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweaks
This commit is contained in:
parent
2f543e5dcb
commit
4dc5fe0b31
@ -60,7 +60,6 @@ void CConfigParser::Initialize(const std::wstring& filename, CMeterWindow* meter
|
|||||||
m_Variables.clear();
|
m_Variables.clear();
|
||||||
|
|
||||||
m_StyleTemplate.clear();
|
m_StyleTemplate.clear();
|
||||||
m_LastUsedStyle.clear();
|
|
||||||
m_LastReplaced = false;
|
m_LastReplaced = false;
|
||||||
m_LastDefaultUsed = false;
|
m_LastDefaultUsed = false;
|
||||||
m_LastValueDefined = false;
|
m_LastValueDefined = false;
|
||||||
@ -568,7 +567,6 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
|||||||
static std::wstring result;
|
static std::wstring result;
|
||||||
|
|
||||||
// Clear last status
|
// Clear last status
|
||||||
m_LastUsedStyle.clear();
|
|
||||||
m_LastReplaced = false;
|
m_LastReplaced = false;
|
||||||
m_LastDefaultUsed = false;
|
m_LastDefaultUsed = false;
|
||||||
m_LastValueDefined = false;
|
m_LastValueDefined = false;
|
||||||
@ -580,9 +578,9 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
|||||||
const std::wstring& strValue = GetValue(strSection, strKey, strDefault);
|
const std::wstring& strValue = GetValue(strSection, strKey, strDefault);
|
||||||
if (&strValue == &strDefault)
|
if (&strValue == &strDefault)
|
||||||
{
|
{
|
||||||
|
bool foundStyleValue = false;
|
||||||
|
|
||||||
// If the template is defined read the value from there.
|
// If the template is defined read the value from there.
|
||||||
if (!m_StyleTemplate.empty())
|
|
||||||
{
|
|
||||||
std::vector<std::wstring>::const_reverse_iterator iter = m_StyleTemplate.rbegin();
|
std::vector<std::wstring>::const_reverse_iterator iter = m_StyleTemplate.rbegin();
|
||||||
for ( ; iter != m_StyleTemplate.rend(); ++iter)
|
for ( ; iter != m_StyleTemplate.rend(); ++iter)
|
||||||
{
|
{
|
||||||
@ -594,13 +592,12 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
|||||||
if (&strStyleValue != &strDefault)
|
if (&strStyleValue != &strDefault)
|
||||||
{
|
{
|
||||||
result = strStyleValue;
|
result = strStyleValue;
|
||||||
m_LastUsedStyle = (*iter);
|
foundStyleValue = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (m_LastUsedStyle.empty()) // No template found
|
if (!foundStyleValue)
|
||||||
{
|
{
|
||||||
result = strDefault;
|
result = strDefault;
|
||||||
m_LastDefaultUsed = true;
|
m_LastDefaultUsed = true;
|
||||||
|
@ -61,7 +61,6 @@ public:
|
|||||||
void SetStyleTemplate(const std::wstring& strStyle) { static const std::wstring delim(1, L'|'); Tokenize(strStyle, delim).swap(m_StyleTemplate); Shrink(m_StyleTemplate); }
|
void SetStyleTemplate(const std::wstring& strStyle) { static const std::wstring delim(1, L'|'); Tokenize(strStyle, delim).swap(m_StyleTemplate); Shrink(m_StyleTemplate); }
|
||||||
void ClearStyleTemplate() { m_StyleTemplate.clear(); }
|
void ClearStyleTemplate() { m_StyleTemplate.clear(); }
|
||||||
|
|
||||||
const std::wstring& GetLastUsedStyle() { return m_LastUsedStyle; }
|
|
||||||
bool GetLastReplaced() { return m_LastReplaced; }
|
bool GetLastReplaced() { return m_LastReplaced; }
|
||||||
bool GetLastDefaultUsed() { return m_LastDefaultUsed; }
|
bool GetLastDefaultUsed() { return m_LastDefaultUsed; }
|
||||||
bool GetLastKeyDefined() { return !m_LastDefaultUsed; }
|
bool GetLastKeyDefined() { return !m_LastDefaultUsed; }
|
||||||
@ -125,7 +124,6 @@ private:
|
|||||||
|
|
||||||
std::vector<std::wstring> m_StyleTemplate;
|
std::vector<std::wstring> m_StyleTemplate;
|
||||||
|
|
||||||
std::wstring m_LastUsedStyle;
|
|
||||||
bool m_LastReplaced;
|
bool m_LastReplaced;
|
||||||
bool m_LastDefaultUsed;
|
bool m_LastDefaultUsed;
|
||||||
bool m_LastValueDefined;
|
bool m_LastValueDefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user