4 #include "http_fetcher.hpp"
5 #include "connection.hpp"
8 // --------------------------------------------------
10 // --------------------------------------------------
11 HttpFetcher::HttpFetcher ()
14 connect (&_http, SIGNAL (done (bool)), SLOT (requestDone (bool)));
18 bool HttpFetcher::busy () const
20 return _http.currentId () != 0;
24 void HttpFetcher::fetch (const QString& url)
28 if (!CHECK_FOR_CONNECTION || ConnectionChecker::instance ()->isConnected ())
30 _http.setHost (u.host ());
31 _http.get (u.encodedPath (), &_buffer);
36 void HttpFetcher::requestDone (bool err)
39 error (_http.error ());
41 done (_buffer.buffer ());
43 _buffer.setBuffer (NULL);