From 3b8ab1e6e8a9358cdcb83e98295ee981e74b6bd6 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Wed, 27 Jun 2012 14:49:52 +0300 Subject: [PATCH] Tweaks --- Library/ConfigParser.h | 4 ++-- Library/MeterWindow.cpp | 14 -------------- Library/MeterWindow.h | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Library/ConfigParser.h b/Library/ConfigParser.h index ce646313..2634bf5d 100644 --- a/Library/ConfigParser.h +++ b/Library/ConfigParser.h @@ -41,7 +41,9 @@ public: ~CConfigParser(); void Initialize(const std::wstring& filename, CMeterWindow* meterWindow = NULL, LPCTSTR skinSection = NULL, const std::wstring* resourcePath = NULL); + void AddMeasure(CMeasure* pMeasure); + CMeasure* GetMeasure(const std::wstring& name); bool GetVariable(const std::wstring& strVariable, std::wstring& strValue); void SetVariable(const std::wstring& strVariable, const std::wstring& strValue) { SetVariable(m_Variables, strVariable, strValue); } @@ -104,8 +106,6 @@ private: void ReadVariables(); - CMeasure* GetMeasure(const std::wstring& name); - void ReadIniFile(const std::wstring& iniFile, LPCTSTR skinSection = NULL, int depth = 0); void SetAutoSelectedMonitorVariables(CMeterWindow* meterWindow); diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 551bf7af..68129399 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -4728,17 +4728,3 @@ CMeter* CMeterWindow::GetMeter(const std::wstring& meterName) } return NULL; } - -CMeasure* CMeterWindow::GetMeasure(const std::wstring& measureName) -{ - const WCHAR* name = measureName.c_str(); - std::list::const_iterator i = m_Measures.begin(); - for ( ; i != m_Measures.end(); ++i) - { - if (_wcsicmp((*i)->GetName(), name) == 0) - { - return (*i); - } - } - return NULL; -} \ No newline at end of file diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 78aa5d6a..a469e728 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -245,7 +245,7 @@ public: Gdiplus::PrivateFontCollection* GetPrivateFontCollection() { return m_FontCollection; } CMeter* GetMeter(const std::wstring& meterName); - CMeasure* GetMeasure(const std::wstring& measureName); + CMeasure* GetMeasure(const std::wstring& measureName) { return m_Parser.GetMeasure(measureName); } friend class CDialogManage;