Do mpd status update after every call to noidle if appropriate

This commit is contained in:
Andrzej Rybczak
2017-01-06 02:10:41 +01:00
parent 0d8b2aee4b
commit e191959976
4 changed files with 15 additions and 1 deletions

View File

@@ -189,6 +189,11 @@ int Connection::noidle()
return flags;
}
void Connection::setNoidleCallback(NoidleCallback callback)
{
m_noidle_callback = std::move(callback);
}
Statistics Connection::getStatistics()
{
prechecks();
@@ -846,7 +851,9 @@ void Connection::checkConnection() const
void Connection::prechecks()
{
checkConnection();
noidle();
int flags = noidle();
if (flags && m_noidle_callback)
m_noidle_callback(flags);
}
void Connection::prechecksNoCommandsList()