From 597e9ec5bc7a0393d2bb7b9c70f71f727181d5ff Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Wed, 3 Feb 2016 15:18:37 +0300 Subject: [PATCH] [ios] Added logging for recent track's duration change. --- .../Maps/MWMRecentTrackSettingsController.mm | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/iphone/Maps/MWMRecentTrackSettingsController.mm b/iphone/Maps/MWMRecentTrackSettingsController.mm index f15d780b48..dfa3364655 100644 --- a/iphone/Maps/MWMRecentTrackSettingsController.mm +++ b/iphone/Maps/MWMRecentTrackSettingsController.mm @@ -1,5 +1,6 @@ #import "MWMRecentTrackSettingsController.h" #import "SelectableCell.h" +#import "Statistics.h" #include "Framework.h" @@ -68,29 +69,36 @@ typedef NS_ENUM(NSUInteger, DurationInHours) { _selectedCell = selectedCell; auto & f = GetFramework(); + auto & tracker = GpsTracker::Instance(); + NSString * statValue = nil; if ([selectedCell isEqual:self.none]) { f.DisconnectFromGpsTracker(); - GpsTracker::Instance().SetEnabled(false); + tracker.SetEnabled(false); + statValue = kStatOff; } else { - if (!GpsTracker::Instance().IsEnabled()) - GpsTracker::Instance().SetEnabled(true); + if (!tracker.IsEnabled()) + tracker.SetEnabled(true); f.ConnectToGpsTracker(); if ([selectedCell isEqual:self.oneHour]) - GpsTracker::Instance().SetDuration(hours(One)); + tracker.SetDuration(hours(One)); else if ([selectedCell isEqual:self.twoHours]) - GpsTracker::Instance().SetDuration(hours(Two)); + tracker.SetDuration(hours(Two)); else if ([selectedCell isEqual:self.sixHours]) - GpsTracker::Instance().SetDuration(hours(Six)); + tracker.SetDuration(hours(Six)); else if ([selectedCell isEqual:self.twelveHours]) - GpsTracker::Instance().SetDuration(hours(Twelve)); + tracker.SetDuration(hours(Twelve)); else - GpsTracker::Instance().SetDuration(hours(Day)); + tracker.SetDuration(hours(Day)); + + statValue = [NSString stringWithFormat:@"%@ hour(s)", @(tracker.GetDuration().count())]; } selectedCell.accessoryType = UITableViewCellAccessoryCheckmark; + [[Statistics instance] logEvent:kStatChangeRecentTrack + withParameters:@{kStatValue : statValue}]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath