replace timeval and time_t with boost::posix_time::ptime

This commit is contained in:
Andrzej Rybczak
2014-08-27 11:14:07 +02:00
parent 7fdace835b
commit b7ceae7273
17 changed files with 75 additions and 78 deletions

View File

@@ -18,7 +18,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include <sys/time.h>
#include <iomanip>
#include "global.h"
@@ -75,10 +74,10 @@ std::wstring ServerInfo::title()
void ServerInfo::update()
{
static timeval past = { 0, 0 };
if (Global::Timer.tv_sec <= past.tv_sec)
Statusbar::printf("%1%, %2%", Global::Timer, m_timer);
if (Global::Timer - m_timer < boost::posix_time::seconds(1))
return;
past = Global::Timer;
m_timer = Global::Timer;
MPD::Statistics stats = Mpd.getStatistics();
if (stats.empty())