Merge branch 'master' into new_panels_with_context_buttons
[situare] / src / engine / engine.cpp
index 4f0359e..8b0ac3c 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "application.h"
 #include "common.h"
-#include "error.h"
+#include "../error.h"
 #include "facebookservice/facebookauthentication.h"
 #include "gps/gpsposition.h"
 #include "map/mapengine.h"
@@ -265,8 +265,6 @@ void SituareEngine::error(const int context, const int error)
         m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
         break;
     case SituareError::ADDRESS_RETRIEVAL_FAILED:
-    case SituareError::ERROR_GEOLOCATION_REQUEST_FAIL:
-    case SituareError::ERROR_GEOLOCATION_LONLAT_INVALID:
         m_ui->toggleProgressIndicator(false);
         m_ui->buildInformationBox(tr("Address retrieval failed"), true);
         break;
@@ -285,9 +283,12 @@ void SituareEngine::error(const int context, const int error)
         m_ui->loggedIn(false);
         m_facebookAuthenticator->clearAccountInformation(false); // clean all
         break;
-    case SituareError::ERROR_GEOLOCATION_SERVER_UNAVAILABLE:
+    case SituareError::ERROR_ROUTING_FAILED:
         m_ui->toggleProgressIndicator(false);
-        m_ui->buildInformationBox(tr("Address server not responding"), true);
+        m_ui->buildInformationBox(tr("Routing failed"), true);
+        break;
+    case SituareError::ERROR_LOCATION_SEARCH_FAILED:
+        m_ui->buildInformationBox(tr("No results found"), true);
         break;
     default:
         m_ui->toggleProgressIndicator(false);
@@ -295,7 +296,6 @@ void SituareEngine::error(const int context, const int error)
             qCritical() << __PRETTY_FUNCTION__ << "QNetworkReply::NetworkError: " << error;
         else
             qCritical() << __PRETTY_FUNCTION__ << "Unknown error: " << error;
-
         break;
     }
 }
@@ -589,6 +589,9 @@ void SituareEngine::signalsFromGeocodingService()
 
     connect(m_geocodingService, SIGNAL(locationDataParsed(const QList<Location>&)),
             m_ui, SIGNAL(locationDataParsed(const QList<Location>&)));
+
+    connect(m_geocodingService, SIGNAL(error(int, int)),
+            this, SLOT(error(int, int)));
 }
 
 void SituareEngine::signalsFromGPS()
@@ -732,6 +735,9 @@ void SituareEngine::signalsFromRoutingService()
 
     connect(m_routingService, SIGNAL(routeParsed(Route&)),
             m_ui, SIGNAL(routeParsed(Route&)));
+
+    connect(m_routingService, SIGNAL(error(int, int)),
+            this, SLOT(error(int, int)));
 }
 
 void SituareEngine::signalsFromSituareService()