#include "traffic.hpp"
#include "log.hpp"
-#include "connection.hpp"
// --------------------------------------------------
{
connect (&_fetcher, SIGNAL (done (const QByteArray&)),
SLOT (fetchDone (const QByteArray&)));
- connect (ConnectionChecker::instance (), SIGNAL (connected (bool)), SLOT (connectionChanged (bool)));
}
// successfully, updated() signal called.
void Traffic::update ()
{
- if (_fetcher.busy ()) {
- Log::instance ()->add ("Traffic::update: fetcher is busy");
- return;
- }
-
Log::instance ()->add ("Traffic::update: Request status download");
_fetcher.fetch ("http://trf.maps.yandex.net/trf/stat.xml");
}
return it.value ();
}
-
-void Traffic::connectionChanged (bool active)
-{
- if (!active)
- _fetcher.reset ();
-}