Ensure that normal mode restores disabled hook status on disabled

Fixes #1744
This commit is contained in:
Maxime Coste 2017-12-06 12:59:31 +08:00
parent 274367116a
commit 936b95ac34

View File

@ -194,11 +194,17 @@ public:
context().hooks().run_hook("NormalBegin", "", context()); context().hooks().run_hook("NormalBegin", "", context());
} }
void on_disabled(bool) override void on_disabled(bool temporary) override
{ {
m_idle_timer.set_next_date(TimePoint::max()); m_idle_timer.set_next_date(TimePoint::max());
m_fs_check_timer.set_next_date(TimePoint::max()); m_fs_check_timer.set_next_date(TimePoint::max());
if (not temporary and m_hooks_disabled)
{
context().hooks_disabled().unset();
m_hooks_disabled = false;
}
context().hooks().run_hook("NormalEnd", "", context()); context().hooks().run_hook("NormalEnd", "", context());
} }