From 669ddfc09dd0cf48dc12a0e3d4c47369d160bbc3 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sat, 18 Feb 2012 13:12:01 +0000 Subject: [PATCH] !CommandMeasure: "Measure Args" is now accepted for backwards compatibility ("Measure" "Args" is preferred!) --- Library/Rainmeter.cpp | 14 ++++++++++++++ Plugins/PluginRecycleManager/RecycleManager.cpp | 2 ++ 2 files changed, 16 insertions(+) diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 1359b301..f746d3ea 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -267,6 +267,20 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfAr } 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"); } } diff --git a/Plugins/PluginRecycleManager/RecycleManager.cpp b/Plugins/PluginRecycleManager/RecycleManager.cpp index d94a271a..95f86388 100644 --- a/Plugins/PluginRecycleManager/RecycleManager.cpp +++ b/Plugins/PluginRecycleManager/RecycleManager.cpp @@ -180,6 +180,8 @@ PLUGIN_EXPORT double Update(void* data) else { // Drive removed + changed = true; + if (data.directory) { CloseHandle(data.directory);