mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-05-09 04:32:13 -05:00
fix crash on disable
This commit is contained in:
parent
92144eaf93
commit
2d699d82b8
|
|
@ -624,19 +624,21 @@ void MacroScheduleTab::ToggleEnabled()
|
|||
}
|
||||
|
||||
// If all selected entries are enabled, disable them; otherwise enable all.
|
||||
auto lock = LockContext();
|
||||
bool allEnabled = true;
|
||||
for (const auto &entry : GetScheduleEntries()) {
|
||||
if (ids.contains(QString::fromStdString(entry.id)) &&
|
||||
!entry.enabled) {
|
||||
allEnabled = false;
|
||||
break;
|
||||
{
|
||||
auto lock = LockContext();
|
||||
bool allEnabled = true;
|
||||
for (const auto &entry : GetScheduleEntries()) {
|
||||
if (ids.contains(QString::fromStdString(entry.id)) &&
|
||||
!entry.enabled) {
|
||||
allEnabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const bool newState = !allEnabled;
|
||||
for (auto &entry : GetScheduleEntries()) {
|
||||
if (ids.contains(QString::fromStdString(entry.id))) {
|
||||
entry.enabled = newState;
|
||||
const bool newState = !allEnabled;
|
||||
for (auto &entry : GetScheduleEntries()) {
|
||||
if (ids.contains(QString::fromStdString(entry.id))) {
|
||||
entry.enabled = newState;
|
||||
}
|
||||
}
|
||||
}
|
||||
Refresh();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user