Instance: move code to OnStateModified()
This commit is contained in:
parent
5d597a3646
commit
6fcea2d484
|
@ -70,6 +70,13 @@ Instance::~Instance() noexcept
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Instance::OnStateModified() noexcept
|
||||||
|
{
|
||||||
|
if (state_file)
|
||||||
|
state_file->CheckModified();
|
||||||
|
}
|
||||||
|
|
||||||
Partition *
|
Partition *
|
||||||
Instance::FindPartition(const char *name) noexcept
|
Instance::FindPartition(const char *name) noexcept
|
||||||
{
|
{
|
||||||
|
|
|
@ -152,6 +152,14 @@ struct Instance final
|
||||||
idle_monitor.OrMask(mask);
|
idle_monitor.OrMask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Find a #Partition with the given name. Returns nullptr if
|
||||||
* no such partition was found.
|
* no such partition was found.
|
||||||
|
|
|
@ -359,9 +359,8 @@ Instance::OnIdle(unsigned flags) noexcept
|
||||||
clients */
|
clients */
|
||||||
client_list->IdleAdd(flags);
|
client_list->IdleAdd(flags);
|
||||||
|
|
||||||
if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT) &&
|
if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT))
|
||||||
state_file != nullptr)
|
OnStateModified();
|
||||||
state_file->CheckModified();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
Loading…
Reference in New Issue