Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladiMihaylenko <vxmihaylenko@gmail.com>2015-12-03 17:38:13 +0300
committerConstantin Shalnev <c.shalnev@corp.mail.ru>2016-01-13 15:54:05 +0300
commitae7bb5e1dae226c0df16ce081885d430209e9087 (patch)
tree1b3ab1c35215caf5fe1d222435722fa275105fad /iphone/Maps/Settings
parentd2fb1d803a6eebf12f9604cca2b19d69db4826bd (diff)
[ios] Added possibility for work in daemon mode (location update only).
Diffstat (limited to 'iphone/Maps/Settings')
-rw-r--r--iphone/Maps/Settings/Preferences.h4
-rw-r--r--iphone/Maps/Settings/Preferences.mm31
2 files changed, 6 insertions, 29 deletions
diff --git a/iphone/Maps/Settings/Preferences.h b/iphone/Maps/Settings/Preferences.h
index 33b74086ba..13918e9878 100644
--- a/iphone/Maps/Settings/Preferences.h
+++ b/iphone/Maps/Settings/Preferences.h
@@ -1,8 +1,6 @@
-#import <Foundation/NSObject.h>
-
// Initialize default preferences if they're not initialized
@interface Preferences : NSObject
-+ (void)setup:(id)controller;
++ (void)setup;
@end
diff --git a/iphone/Maps/Settings/Preferences.mm b/iphone/Maps/Settings/Preferences.mm
index 402962e9df..cc51b99218 100644
--- a/iphone/Maps/Settings/Preferences.mm
+++ b/iphone/Maps/Settings/Preferences.mm
@@ -1,44 +1,23 @@
#import "Preferences.h"
-#import "../Classes/MapViewController.h"
#include "Framework.h"
#include "platform/settings.hpp"
-//********************* Helper delegate to handle async dialog message ******************
-@interface PrefDelegate : NSObject
-@property (nonatomic, weak) id m_controller;
-@end
-
-@implementation PrefDelegate
-
-@end
-//***************************************************************************************
-
@implementation Preferences
// TODO: Export this logic to C++
-+ (void)setup:(id)controller
++ (void)setup
{
Settings::Units u;
- if (!Settings::Get("Units", u))
+ string const units = "Units";
+ if (!Settings::Get(units, u))
{
// get system locale preferences
BOOL const isMetric = [[[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleUsesMetricSystem] boolValue];
- if (isMetric)
- {
- u = Settings::Metric;
- }
- else
- {
- u = Settings::Foot;
- // Will be released in delegate's callback itself
- PrefDelegate * d = [[PrefDelegate alloc] init];
- d.m_controller = controller;
- }
-
- Settings::Set("Units", u);
+ u = isMetric ? Settings::Metric : Settings::Foot;
+ Settings::Set(units, u);
}
GetFramework().SetupMeasurementSystem();
}