use flag to force status update rather than doing additional update

This commit is contained in:
Andrzej Rybczak
2009-04-01 16:15:19 +02:00
parent 89c06db1f4
commit 7f85a0dcd1
4 changed files with 22 additions and 18 deletions

View File

@@ -40,6 +40,8 @@ using std::string;
string Global::VolumeState;
bool Global::UpdateStatusImmediately = 0;
namespace
{
time_t time_of_statusbar_lock;
@@ -115,13 +117,15 @@ void TraceMpdStatus()
static timeval past, now;
gettimeofday(&now, 0);
if (Mpd->Connected()
&& ((now.tv_sec == past.tv_sec && now.tv_usec >= past.tv_usec+500000) || now.tv_sec > past.tv_sec)
if ((Mpd->Connected()
&& ((now.tv_sec == past.tv_sec && now.tv_usec >= past.tv_usec+500000) || now.tv_sec > past.tv_sec))
|| UpdateStatusImmediately
)
{
Mpd->UpdateStatus();
BlockItemListUpdate = 0;
Playlist::BlockUpdate = 0;
UpdateStatusImmediately = 0;
gettimeofday(&past, 0);
}
wFooter->Refresh();