From d92f4f939d12cecb4e62bc1b3562b803cc5eebe2 Mon Sep 17 00:00:00 2001 From: spx Date: Mon, 2 Aug 2010 14:28:55 +0000 Subject: [PATCH] Added #ROOTCONFIGPATH#. --- Library/ConfigParser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 6681351d..17e40134 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -129,6 +129,19 @@ void CConfigParser::SetDefaultVariables(CRainmeter* pRainmeter, CMeterWindow* me SetVariable(L"CURRENTPATH", CRainmeter::ExtractPath(m_Filename)); SetVariable(L"ADDONSPATH", pRainmeter->GetPath() + L"Addons\\"); SetVariable(L"CRLF", L"\n"); + + if (meterWindow) + { + const std::wstring& config = meterWindow->GetSkinName(); + if ((loc = config.find_first_of(L'\\')) != std::wstring::npos) + { + SetVariable(L"ROOTCONFIGPATH", pRainmeter->GetSkinPath() + config.substr(0, loc + 1)); + } + else + { + SetVariable(L"ROOTCONFIGPATH", pRainmeter->GetSkinPath() + config + L"\\"); + } + } } if (meterWindow) {