Commit 6fcea2d4 authored by Max Kellermann's avatar Max Kellermann

Instance: move code to OnStateModified()

parent 5d597a36
......@@ -70,6 +70,13 @@ Instance::~Instance() noexcept
#endif
}
void
Instance::OnStateModified() noexcept
{
if (state_file)
state_file->CheckModified();
}
Partition *
Instance::FindPartition(const char *name) noexcept
{
......
......@@ -153,6 +153,14 @@ struct Instance final
}
/**
* Notify the #Instance that the state has been modified, and
* the #StateFile may need to be saved.
*
* This method must be called from the main thread.
*/
void OnStateModified() noexcept;
/**
* Find a #Partition with the given name. Returns nullptr if
* no such partition was found.
*/
......
......@@ -359,9 +359,8 @@ Instance::OnIdle(unsigned flags) noexcept
clients */
client_list->IdleAdd(flags);
if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT) &&
state_file != nullptr)
state_file->CheckModified();
if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT))
OnStateModified();
}
static inline void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment