Fix typo
[yandex-traffic] / http_fetcher.cpp
index a518e9f..23e4f18 100644 (file)
@@ -2,8 +2,6 @@
 #include <QtNetwork>
 
 #include "http_fetcher.hpp"
-#include "connection.hpp"
-#include "globals.hpp"
 
 // --------------------------------------------------
 // HttpFetcher
@@ -15,21 +13,17 @@ HttpFetcher::HttpFetcher ()
 }
 
 
-bool HttpFetcher::busy () const
-{
-    return _http.currentId () != 0;
-}
-
-
 void HttpFetcher::fetch (const QString& url)
 {
     QUrl u (url);
 
-    if (!CHECK_FOR_CONNECTION || ConnectionChecker::instance ()->isConnected ())
-        if (u.isValid ()) {
-            _http.setHost (u.host ());
-            _http.get (u.encodedPath (), &_buffer);
-        }
+    if (_http.currentId () != 0)
+        _http.abort ();
+
+    if (u.isValid ()) {
+        _http.setHost (u.host ());
+        _http.get (u.encodedPath (), &_buffer);
+    }
 }
 
 
@@ -42,3 +36,4 @@ void HttpFetcher::requestDone (bool err)
     _buffer.close ();
     _buffer.setBuffer (NULL);
 }
+