From 8b605c8fc58ae9f69419ab603e0c5e79ce66142b Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Thu, 8 Sep 2011 14:46:49 +0000 Subject: [PATCH] Additional change for r940. --- Library/Rainmeter.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 5f95ca67..7c7cbeb3 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -1302,12 +1302,21 @@ void RainmeterActivateConfigWide(const WCHAR* arg) if (subStrings.size() > 1) { - CMeterWindow* mw = Rainmeter->GetMeterWindow(subStrings[0]); - if (mw) + const std::vector& configs = Rainmeter->GetAllConfigs(); + + for (int i = 0, isize = (int)configs.size(); i < isize; ++i) { - std::pair indexes = Rainmeter->GetMeterWindowIndex(mw); - Rainmeter->ActivateConfig(indexes.first, indexes.second); - return; + if (_wcsicmp(configs[i].config.c_str(), subStrings[0].c_str()) == 0) + { + for (int j = 0, jsize = (int)configs[i].iniFiles.size(); j < jsize; ++j) + { + if (_wcsicmp(configs[i].iniFiles[j].c_str(), subStrings[1].c_str()) == 0) + { + Rainmeter->ActivateConfig(i, j); + return; + } + } + } } LogWithArgs(LOG_NOTICE, L"No such config: \"%s\" \"%s\"", subStrings[0].c_str(), subStrings[1].c_str()); }