diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 4db6f34a..166a7ca6 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -104,6 +104,7 @@ void ConfigParser::SetBuiltInVariables(const std::wstring& filename, const std:: { insertVariable(L"CURRENTFILE", meterWindow->GetFileName()); insertVariable(L"CURRENTCONFIG", meterWindow->GetFolderPath()); + insertVariable(L"ROOTCONFIG", meterWindow->GetRootName()); insertVariable(L"ROOTCONFIGPATH", meterWindow->GetRootPath()); } diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 94dd5a31..93e8e3e5 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -4841,6 +4841,17 @@ std::wstring MeterWindow::GetFilePath() return file; } +std::wstring MeterWindow::GetRootName() +{ + std::wstring::size_type loc; + if ((loc = m_FolderPath.find_first_of(L'\\')) != std::wstring::npos) + { + return m_FolderPath.substr(0, loc); + } + + return m_FolderPath; +} + std::wstring MeterWindow::GetRootPath() { std::wstring path = GetRainmeter().GetSkinPath(); diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index c4f8d8b6..399b557b 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -162,6 +162,7 @@ public: const std::wstring& GetFolderPath() { return m_FolderPath; } const std::wstring& GetFileName() { return m_FileName; } std::wstring GetFilePath(); + std::wstring GetRootName(); std::wstring GetRootPath(); std::wstring GetResourcesPath(); std::wstring GetSkinPath();