diff options
author | vng <viktor.govako@gmail.com> | 2013-02-08 19:16:51 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:49:46 +0300 |
commit | aca14466854d86c2890d1ed4f24bbb84b85b6b63 (patch) | |
tree | ff8eb7359e12f8ea979697843d2fed338a64be60 /platform | |
parent | a113092f7b9555ce2efa5960186fabc7cde82382 (diff) |
Remove Platform::ScaleEtalonSize and other old stuff.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/platform.cpp | 5 | ||||
-rw-r--r-- | platform/platform.hpp | 7 | ||||
-rw-r--r-- | platform/platform_android.cpp | 22 | ||||
-rw-r--r-- | platform/platform_ios.mm | 45 | ||||
-rw-r--r-- | platform/platform_linux.cpp | 4 | ||||
-rw-r--r-- | platform/platform_mac.mm | 4 | ||||
-rw-r--r-- | platform/platform_qt.cpp | 15 |
7 files changed, 18 insertions, 84 deletions
diff --git a/platform/platform.cpp b/platform/platform.cpp index 185632e552..9f6f4e2d32 100644 --- a/platform/platform.cpp +++ b/platform/platform.cpp @@ -76,3 +76,8 @@ void Platform::GetFilesByExt(string const & directory, string const & ext, Files GetFilesByRegExp(directory, '\\' + ext + '$', outFiles); } + +string Platform::DeviceName() const +{ + return OMIM_OS_NAME; +} diff --git a/platform/platform.hpp b/platform/platform.hpp index c47ff5beb9..b826dc970e 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -29,10 +29,6 @@ protected: /// Flag that it's a paid PRO version of app. bool m_isPro; - class PlatformImpl; - /// Used only on those platforms where needed - PlatformImpl * m_impl; - /// Internal function to use files from writable dir /// if they override the same file in the resources dir string ReadPathForFile(string const & file) const; @@ -42,7 +38,6 @@ protected: public: Platform(); - ~Platform(); static bool IsFileExistsByFullPath(string const & filePath); @@ -122,8 +117,6 @@ public: string DeviceName() const; - int ScaleEtalonSize() const; - string UniqueClientId() const; inline bool IsPro() const { return m_isPro; } diff --git a/platform/platform_android.cpp b/platform/platform_android.cpp index 9ff174079b..04ca781ed1 100644 --- a/platform/platform_android.cpp +++ b/platform/platform_android.cpp @@ -11,11 +11,10 @@ #include <unistd.h> -Platform::Platform() : m_impl(0) -{} - -Platform::~Platform() -{} +Platform::Platform() +{ + /// @see initialization routine in android/jni/com/.../Platform.hpp +} ModelReader * Platform::GetReader(string const & file) const { @@ -77,19 +76,14 @@ int Platform::CpuCores() const return (numCPU > 1 ? static_cast<int>(numCPU) : 1); } -string Platform::DeviceName() const -{ - return "Android"; -} - -int Platform::ScaleEtalonSize() const +int Platform::VideoMemoryLimit() const { - return 512 + 256; + return 10 * 1024 * 1024; } -int Platform::VideoMemoryLimit() const +int Platform::PreCachingDepth() const { - return 10 * 1024 * 1024; + return 3; } bool Platform::GetFileSizeByName(string const & fileName, uint64_t & size) const diff --git a/platform/platform_ios.mm b/platform/platform_ios.mm index 5b99e1e161..8492d4b605 100644 --- a/platform/platform_ios.mm +++ b/platform/platform_ios.mm @@ -26,18 +26,8 @@ #import <UIKit/UIScreenMode.h> -class Platform::PlatformImpl -{ -public: - int m_scaleEtalonSize; - string m_deviceName; - int m_videoMemoryLimit; -}; - Platform::Platform() { - m_impl = new PlatformImpl; - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSBundle * bundle = [NSBundle mainBundle]; @@ -53,37 +43,16 @@ Platform::Platform() m_tmpDir = [NSHomeDirectory() UTF8String]; m_tmpDir += "/tmp/"; - m_impl->m_videoMemoryLimit = 8 * 1024 * 1024; - - UIDevice * device = [UIDevice currentDevice]; - NSRange range = [device.model rangeOfString:@"iPad"]; - if (range.location != NSNotFound) - m_impl->m_deviceName = "iPad"; - else - { - range = [device.model rangeOfString:@"iPod"]; - if (range.location != NSNotFound) - m_impl->m_deviceName = "iPod"; - else - m_impl->m_deviceName = "iPhone"; - } - - m_impl->m_scaleEtalonSize = 256 * 1.5 * [[UIScreen mainScreen] scale]; - NSString * appID = [[bundle infoDictionary] objectForKey:@"CFBundleIdentifier"]; // .travelguide corresponds to the Lite version without search m_isPro = ([appID rangeOfString:@"com.mapswithme.travelguide"].location == NSNotFound); + UIDevice * device = [UIDevice currentDevice]; NSLog(@"Device: %@, SystemName: %@, SystemVersion: %@", device.model, device.systemName, device.systemVersion); [pool release]; } -Platform::~Platform() -{ - delete m_impl; -} - void Platform::GetFilesByRegExp(string const & directory, string const & regexp, FilesList & res) { pl::EnumerateFilesByRegExp(directory, regexp, res); @@ -115,14 +84,9 @@ int Platform::CpuCores() const return 1; } -int Platform::ScaleEtalonSize() const -{ - return m_impl->m_scaleEtalonSize; -} - int Platform::VideoMemoryLimit() const { - return m_impl->m_videoMemoryLimit; + return 8 * 1024 * 1024; } int Platform::PreCachingDepth() const @@ -130,11 +94,6 @@ int Platform::PreCachingDepth() const return 2; } -string Platform::DeviceName() const -{ - return m_impl->m_deviceName; -} - static string GetDeviceUid() { NSString * uid = [[UIDevice currentDevice] uniqueIdentifier]; diff --git a/platform/platform_linux.cpp b/platform/platform_linux.cpp index b3c20ab0ad..2b44259284 100644 --- a/platform/platform_linux.cpp +++ b/platform/platform_linux.cpp @@ -42,10 +42,6 @@ Platform::Platform() LOG(LDEBUG, ("Settings directory:", m_settingsDir)); } -Platform::~Platform() -{ -} - int Platform::CpuCores() const { const long numCPU = sysconf(_SC_NPROCESSORS_ONLN); diff --git a/platform/platform_mac.mm b/platform/platform_mac.mm index b1efe1c197..248892e3d5 100644 --- a/platform/platform_mac.mm +++ b/platform/platform_mac.mm @@ -65,10 +65,6 @@ Platform::Platform() LOG(LDEBUG, ("Settings Directory:", m_settingsDir)); } -Platform::~Platform() -{ -} - int Platform::CpuCores() const { int mib[2], numCPU = 0; diff --git a/platform/platform_qt.cpp b/platform/platform_qt.cpp index e5bf38d9b7..25165f59d6 100644 --- a/platform/platform_qt.cpp +++ b/platform/platform_qt.cpp @@ -12,7 +12,6 @@ #include <QtCore/QFileInfo> -//////////////////////////////////////////////////////////////////////////////////////// ModelReader * Platform::GetReader(string const & file) const { return new FileReader(ReadPathForFile(file), @@ -47,29 +46,21 @@ void Platform::GetFilesByRegExp(string const & directory, string const & regexp, } } -string Platform::DeviceName() const -{ - return OMIM_OS_NAME; -} - int Platform::PreCachingDepth() const { return 3; } -int Platform::ScaleEtalonSize() const -{ - return 512 + 256; -} - int Platform::VideoMemoryLimit() const { return 20 * 1024 * 1024; } -/////////////////////////////////////////////////////////////////////////////// + extern Platform & GetPlatform() { + // We need this derive class because Platform::Platform for desktop + // has special initialization in every platform. class PlatformQt : public Platform { public: |