Faced with problem: in scratchbox, we actually have no internet connection from
icd2 point of view.
--- /dev/null
+#ifndef __GLOBALS_H__
+#define __GLOBALS_H__
+
+
+// Will widget check for internet connection presence?
+// For debuggin in scratchbox must be set to 0, for real device, set 1
+#define CHECK_FOR_CONNECTION 0
+
+
+#endif // __GLOBALS_H__
#include <QtNetwork>
#include "http_fetcher.hpp"
-
+#include "connection.hpp"
+#include "globals.hpp"
// --------------------------------------------------
// HttpFetcher
{
QUrl u (url);
- if (u.isValid ()) {
- _http.setHost (u.host ());
- _http.get (u.encodedPath (), &_buffer);
- }
+ if (!CHECK_FOR_CONNECTION || ConnectionChecker::instance ()->isConnected ())
+ if (u.isValid ()) {
+ _http.setHost (u.host ());
+ _http.get (u.encodedPath (), &_buffer);
+ }
}
HEADERS += $$PWD/regions.hpp $$PWD/settings.hpp $$PWD/traffic.hpp $$PWD/http_fetcher.hpp $$PWD/connection.hpp
SOURCES += $$PWD/regions.cpp $$PWD/settings.cpp $$PWD/traffic.cpp $$PWD/http_fetcher.cpp $$PWD/connection.cpp
-HEADERS += $$PWD/icd2_light.h
+HEADERS += $$PWD/icd2_light.h $$PWD/globals.hpp
QT += network xml dbus
CONFIG += qdbus