mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
IfActions: Tweaks
This commit is contained in:
parent
fa81ea4fe9
commit
b492d40f61
@ -55,9 +55,11 @@ void IfActions::ReadOptions(ConfigParser& parser, const WCHAR* section)
|
||||
void IfActions::ReadConditionOptions(ConfigParser& parser, const WCHAR* section)
|
||||
{
|
||||
std::wstring condition = parser.ReadString(section, L"IfCondition", L"");
|
||||
if (!condition.empty())
|
||||
{
|
||||
std::wstring tAction = parser.ReadString(section, L"IfTrueAction", L"", false);
|
||||
std::wstring fAction = parser.ReadString(section, L"IfFalseAction", L"", false);
|
||||
if (!condition.empty() && (!tAction.empty() || !fAction.empty()))
|
||||
if (!tAction.empty() || !fAction.empty())
|
||||
{
|
||||
int i = 1;
|
||||
do
|
||||
@ -72,16 +74,23 @@ void IfActions::ReadConditionOptions(ConfigParser& parser, const WCHAR* section)
|
||||
}
|
||||
|
||||
// Check for IfCondition2/IfTrueAction2/IfFalseAction2 ... etc.
|
||||
std::wstring key = L"IfTrueAction" + std::to_wstring(++i);
|
||||
tAction = parser.ReadString(section, key.c_str(), L"", false);
|
||||
key = L"IfFalseAction" + std::to_wstring(i);
|
||||
fAction = parser.ReadString(section, key.c_str(), L"", false);
|
||||
const std::wstring num = std::to_wstring(++i);
|
||||
|
||||
key = L"IfCondition" + std::to_wstring(i);
|
||||
std::wstring key = L"IfCondition" + num;
|
||||
condition = parser.ReadString(section, key.c_str(), L"");
|
||||
if (condition.empty()) break;
|
||||
|
||||
key = L"IfTrueAction" + num;
|
||||
tAction = parser.ReadString(section, key.c_str(), L"", false);
|
||||
key = L"IfFalseAction" + num;
|
||||
fAction = parser.ReadString(section, key.c_str(), L"", false);
|
||||
}
|
||||
while (!tAction.empty() || !fAction.empty());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Conditions.clear();
|
||||
}
|
||||
while (!condition.empty() && (!tAction.empty() || !fAction.empty()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user