!CommandMeasure: "Measure Args" is now accepted for backwards compatibility ("Measure" "Args" is preferred!)

This commit is contained in:
Birunthan Mohanathas 2012-02-18 13:12:01 +00:00
parent b48791dd58
commit 669ddfc09d
2 changed files with 16 additions and 0 deletions

View File

@ -267,6 +267,20 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfAr
} }
else else
{ {
// For backwards compatibility
if (bang == BANG_COMMANDMEASURE && subStringsSize >= 1)
{
std::wstring tmpSz = arg;
std::wstring::size_type pos = tmpSz.find_first_of(L' ');
if (pos != std::wstring::npos)
{
tmpSz.replace(pos, 1, L"\" \"");
BangWithArgs(bang, tmpSz.c_str(), numOfArgs, meterWindow);
Log(LOG_WARNING, L"!CommandMeasure: Two parameters required, only one given");
return;
}
}
Log(LOG_ERROR, L"Bang: Incorrect number of arugments"); Log(LOG_ERROR, L"Bang: Incorrect number of arugments");
} }
} }

View File

@ -180,6 +180,8 @@ PLUGIN_EXPORT double Update(void* data)
else else
{ {
// Drive removed // Drive removed
changed = true;
if (data.directory) if (data.directory)
{ {
CloseHandle(data.directory); CloseHandle(data.directory);