From 946bf7b727cce9dbc8a0c1b0f7f7ddec2d2d16cb Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 21 Oct 2011 18:39:00 +0300 Subject: [qt][ios] Refactored location manager --- platform/wifi_location_service.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'platform/wifi_location_service.cpp') diff --git a/platform/wifi_location_service.cpp b/platform/wifi_location_service.cpp index eba5f5d6eb..20aa87a6b9 100644 --- a/platform/wifi_location_service.cpp +++ b/platform/wifi_location_service.cpp @@ -1,4 +1,4 @@ -#include "location.hpp" +#include "location_service.hpp" #include "wifi_info.hpp" #include "download_manager.hpp" @@ -46,10 +46,9 @@ namespace location info.m_longitude = json_real_value(lon); info.m_horizontalAccuracy = json_real_value(acc); // @TODO introduce flags to mark valid values - info.m_status = EAccurateMode; info.m_timestamp = static_cast(time(NULL)); info.m_source = location::EGoogle; - NotifyGpsObserver(info); + m_observer.OnGpsUpdated(info); return; } } @@ -91,21 +90,25 @@ namespace location } public: - virtual void StartUpdate(bool) + WiFiLocationService(LocationObserver & observer) : LocationService(observer) + { + } + + virtual void Start() { m_wifiInfo.RequestWiFiBSSIDs(bind(&WiFiLocationService::OnWifiScanCompleted, this, _1)); } - virtual void StopUpdate() + virtual void Stop() { m_wifiInfo.Stop(); } }; } -location::LocationService * CreateWiFiLocationService() +extern "C" location::LocationService * CreateWiFiLocationService(location::LocationObserver & observer) { // small hack - create and initialize downloader in main thread GetDownloadManager(); - return new location::WiFiLocationService(); + return new location::WiFiLocationService(observer); } -- cgit v1.2.3