| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -127,8 +127,7 @@ MapPanel::MapPanel(QWidget* parent) : QWidget(parent) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      QString url = CommaApi::BASE_URL + "/v1/navigation/" + *dongle_id + "/locations"; | 
					 | 
					 | 
					 | 
					      QString url = CommaApi::BASE_URL + "/v1/navigation/" + *dongle_id + "/locations"; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      RequestRepeater* repeater = new RequestRepeater(this, url, "ApiCache_NavDestinations", 30, true); | 
					 | 
					 | 
					 | 
					      RequestRepeater* repeater = new RequestRepeater(this, url, "ApiCache_NavDestinations", 30, true); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      QObject::connect(repeater, &RequestRepeater::receivedResponse, this, &MapPanel::parseResponse); | 
					 | 
					 | 
					 | 
					      QObject::connect(repeater, &RequestRepeater::requestDone, this, &MapPanel::parseResponse); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      QObject::connect(repeater, &RequestRepeater::failedResponse, this, &MapPanel::failedResponse); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Destination set while offline
 | 
					 | 
					 | 
					 | 
					    // Destination set while offline
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -137,8 +136,8 @@ MapPanel::MapPanel(QWidget* parent) : QWidget(parent) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      RequestRepeater* repeater = new RequestRepeater(this, url, "", 10, true); | 
					 | 
					 | 
					 | 
					      RequestRepeater* repeater = new RequestRepeater(this, url, "", 10, true); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      HttpRequest* deleter = new HttpRequest(this); | 
					 | 
					 | 
					 | 
					      HttpRequest* deleter = new HttpRequest(this); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      QObject::connect(repeater, &RequestRepeater::receivedResponse, [=](QString resp) { | 
					 | 
					 | 
					 | 
					      QObject::connect(repeater, &RequestRepeater::requestDone, [=](const QString &resp, bool success) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (resp != "null") { | 
					 | 
					 | 
					 | 
					        if (success && resp != "null") { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          if (params.get("NavDestination").empty()) { | 
					 | 
					 | 
					 | 
					          if (params.get("NavDestination").empty()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            qWarning() << "Setting NavDestination from /next" << resp; | 
					 | 
					 | 
					 | 
					            qWarning() << "Setting NavDestination from /next" << resp; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            params.put("NavDestination", resp.toStdString()); | 
					 | 
					 | 
					 | 
					            params.put("NavDestination", resp.toStdString()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -183,7 +182,12 @@ void MapPanel::updateCurrentRoute() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  current_widget->setVisible(dest.size() && !doc.isNull()); | 
					 | 
					 | 
					 | 
					  current_widget->setVisible(dest.size() && !doc.isNull()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void MapPanel::parseResponse(const QString &response) { | 
					 | 
					 | 
					 | 
					void MapPanel::parseResponse(const QString &response, bool success) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  if (!success) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    stack->setCurrentIndex(1); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8()); | 
					 | 
					 | 
					 | 
					  QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if (doc.isNull()) { | 
					 | 
					 | 
					 | 
					  if (doc.isNull()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    qDebug() << "JSON Parse failed on navigation locations"; | 
					 | 
					 | 
					 | 
					    qDebug() << "JSON Parse failed on navigation locations"; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -283,10 +287,6 @@ void MapPanel::parseResponse(const QString &response) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  repaint(); | 
					 | 
					 | 
					 | 
					  repaint(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void MapPanel::failedResponse(const QString &response) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  stack->setCurrentIndex(1); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void MapPanel::navigateTo(const QJsonObject &place) { | 
					 | 
					 | 
					 | 
					void MapPanel::navigateTo(const QJsonObject &place) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QJsonDocument doc(place); | 
					 | 
					 | 
					 | 
					  QJsonDocument doc(place); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  params.put("NavDestination", doc.toJson().toStdString()); | 
					 | 
					 | 
					 | 
					  params.put("NavDestination", doc.toJson().toStdString()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |