From 5e9235f1723e59522e112aeec8b88c9be2fdcaf1 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 19 Dec 2011 19:59:10 +0300 Subject: [PATCH] [android] Removed trick with countries sizes caching - it's not needed because of changed logic in the UI --- android/jni/com/mapswithme/maps/DownloadUI.cpp | 18 ++---------------- .../jni/com/mapswithme/maps/MWMActivity.cpp | 11 ----------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/android/jni/com/mapswithme/maps/DownloadUI.cpp b/android/jni/com/mapswithme/maps/DownloadUI.cpp index a35ea76c86..d620e0bf42 100644 --- a/android/jni/com/mapswithme/maps/DownloadUI.cpp +++ b/android/jni/com/mapswithme/maps/DownloadUI.cpp @@ -74,32 +74,18 @@ extern "C" return env->NewStringUTF(name.c_str()); } - // @TODO Small hack to save time by caching last file size - storage::TIndex g_lastCountryIndex(storage::TIndex::INVALID); - storage::LocalAndRemoteSizeT g_lastSize(-1, -1); - JNIEXPORT jlong JNICALL Java_com_mapswithme_maps_DownloadUI_countryLocalSizeInBytes(JNIEnv * env, jobject thiz, jint group, jint country, jint region) { - storage::TIndex const index(group, country, region); - if (index == g_lastCountryIndex) - return g_lastSize.first; - g_lastCountryIndex = index; - g_lastSize = g_framework->Storage().CountrySizeInBytes(index); - return g_lastSize.first; + return g_framework->Storage().CountrySizeInBytes(storage::TIndex(group, country, region)).first; } JNIEXPORT jlong JNICALL Java_com_mapswithme_maps_DownloadUI_countryRemoteSizeInBytes(JNIEnv * env, jobject thiz, jint group, jint country, jint region) { - storage::TIndex const index(group, country, region); - if (index == g_lastCountryIndex) - return g_lastSize.second; - g_lastCountryIndex = index; - g_lastSize = g_framework->Storage().CountrySizeInBytes(index); - return g_lastSize.second; + return g_framework->Storage().CountrySizeInBytes(storage::TIndex(group, country, region)).first; } JNIEXPORT jint JNICALL diff --git a/android/jni/com/mapswithme/maps/MWMActivity.cpp b/android/jni/com/mapswithme/maps/MWMActivity.cpp index f3a89da0fe..4398ba6f7f 100644 --- a/android/jni/com/mapswithme/maps/MWMActivity.cpp +++ b/android/jni/com/mapswithme/maps/MWMActivity.cpp @@ -1,14 +1,3 @@ -/* - * MWMActivity.cpp - * - * Created on: Oct 13, 2011 - * Author: siarheirachytski - */ - -/////////////////////////////////////////////////////////////////////////////////// -// MWMActivity -/////////////////////////////////////////////////////////////////////////////////// - #include #include "../core/logging.hpp"