diff options
author | Alex Zolotarev <deathbaba@gmail.com> | 2011-10-21 19:39:00 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:26:32 +0300 |
commit | 946bf7b727cce9dbc8a0c1b0f7f7ddec2d2d16cb (patch) | |
tree | 1750b08be8882e1d656ca42253085b3fc7909230 /platform/wifi_location_service.cpp | |
parent | 43a0bd87f5856a303d552ca895dd0fea72a1ecda (diff) |
[qt][ios] Refactored location manager
Diffstat (limited to 'platform/wifi_location_service.cpp')
-rw-r--r-- | platform/wifi_location_service.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
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<double>(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); } |