Some of the plugins don't work with the dynamic variables so the feature is now disabled for them.

This commit is contained in:
Kimmo Pekkola 2009-08-26 19:29:49 +00:00
parent 9cf291517a
commit ffdec7be65
5 changed files with 7 additions and 6 deletions

View File

@ -129,7 +129,7 @@ void CConfigParser::SetVariable(const std::wstring& strVariable, const std::wstr
**
**
*/
const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue)
const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue, bool bReplaceMeasures)
{
static std::wstring result;
@ -194,7 +194,7 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
} while(loop);
// Check for measures ([Measure])
if (!m_Measures.empty())
if (!m_Measures.empty() && bReplaceMeasures)
{
start = 0;
end = std::wstring::npos;

View File

@ -40,7 +40,7 @@ public:
void AddMeasure(CMeasure* pMeasure);
void SetVariable(const std::wstring& strVariable, const std::wstring& strValue);
const std::wstring& ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue);
const std::wstring& ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue, bool bReplaceMeasures = true);
double ReadFloat(LPCTSTR section, LPCTSTR key, double defValue);
double ReadFormula(LPCTSTR section, LPCTSTR key, double defValue);
int ReadInt(LPCTSTR section, LPCTSTR key, int defValue);

View File

@ -36,6 +36,7 @@
#include <tchar.h>
#include "MeasureCalc.h"
#include "MeasureNet.h"
#include "MeasurePlugin.h"
#include "MeterButton.h"
using namespace Gdiplus;
@ -1875,7 +1876,7 @@ void CMeterWindow::Update(bool nodraw)
{
try
{
if ((*i)->HasDynamicVariables())
if ((*i)->HasDynamicVariables() && dynamic_cast<CMeasurePlugin*>((*i)) == NULL) // Plugins are not meant to be reinitialized
{
(*i)->ReadConfig(m_Parser, (*i)->GetName());
}

View File

@ -180,7 +180,7 @@ LPCTSTR ReadConfigString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue)
CConfigParser* parser = Rainmeter->GetCurrentParser();
if (parser)
{
return parser->ReadString(section, key, defValue).c_str();
return parser->ReadString(section, key, defValue, false).c_str();
}
}
return NULL;

View File

@ -1,2 +1,2 @@
#pragma once
const int revision_number = 185;
const int revision_number = 191;