Additional change for r1191.

This commit is contained in:
spx 2012-02-15 07:07:50 +00:00
parent b786c12bac
commit 6fec1dc759

View File

@ -224,20 +224,15 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfAr
if (subStringsSize >= numOfArgs) if (subStringsSize >= numOfArgs)
{ {
if (subStringsSize == numOfArgs) if (subStringsSize == numOfArgs && meterWindow)
{
if (meterWindow)
{ {
meterWindow->RunBang(bang, subStrings); meterWindow->RunBang(bang, subStrings);
} }
else else
{
Log(LOG_ERROR, L"Bang: Config not specified");
}
}
else // if (subStringsSize > numOfArgs)
{ {
// Use the specified window instead of meterWindow parameter // Use the specified window instead of meterWindow parameter
if (subStringsSize > numOfArgs)
{
const std::wstring& config = subStrings[numOfArgs]; const std::wstring& config = subStrings[numOfArgs];
if (!config.empty() && (config.length() != 1 || config[0] != L'*')) if (!config.empty() && (config.length() != 1 || config[0] != L'*'))
{ {
@ -250,9 +245,10 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfAr
{ {
LogWithArgs(LOG_ERROR, L"Bang: Config \"%s\" not found", config.c_str()); LogWithArgs(LOG_ERROR, L"Bang: Config \"%s\" not found", config.c_str());
} }
return;
} }
else }
{
// No config defined -> apply to all. // No config defined -> apply to all.
std::map<std::wstring, CMeterWindow*>::const_iterator iter = m_MeterWindows.begin(); std::map<std::wstring, CMeterWindow*>::const_iterator iter = m_MeterWindows.begin();
for (; iter != m_MeterWindows.end(); ++iter) for (; iter != m_MeterWindows.end(); ++iter)
@ -261,7 +257,6 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfAr
} }
} }
} }
}
else else
{ {
Log(LOG_ERROR, L"Bang: Incorrect number of arugments"); Log(LOG_ERROR, L"Bang: Incorrect number of arugments");