From 8a80ba34236dc0a6cea112a02c805d662177afac Mon Sep 17 00:00:00 2001 From: Dmitry Kunin Date: Wed, 18 Dec 2013 12:31:14 +0300 Subject: [PATCH] [CodeReview] --- .../jni/com/mapswithme/maps/StatsClient.cpp | 13 ++++--- .../util/statistics/Statistics.java | 5 +-- .../util/statistics/StatsClient.java | 4 ++- omim_light.pro | 34 ------------------- stats/client/stats_client.cpp | 8 ----- stats/client/stats_client.hpp | 1 - stats/client/stats_writer.cpp | 3 +- stats/stats.pro | 4 --- 8 files changed, 11 insertions(+), 61 deletions(-) delete mode 100644 omim_light.pro diff --git a/android/jni/com/mapswithme/maps/StatsClient.cpp b/android/jni/com/mapswithme/maps/StatsClient.cpp index e78c7fd79e..283861d66d 100644 --- a/android/jni/com/mapswithme/maps/StatsClient.cpp +++ b/android/jni/com/mapswithme/maps/StatsClient.cpp @@ -3,19 +3,18 @@ extern "C" { - static stats::Client * m_client = 0; + static stats::Client * g_client = 0; stats::Client * NativeStat() { - if (!m_client) - m_client = new stats::Client(); - return m_client; + if (!g_client) + g_client = new stats::Client(); + return g_client; } JNIEXPORT jboolean JNICALL - Java_com_mapswithme_util_StatsClient_trackSearchQuery(JNIEnv * env, jobject thiz, jstring query) + Java_com_mapswithme_util_StatsClient_trackSearchQuery(JNIEnv * env, jclass clazz, jstring query) { - NativeStat()->Search(jni::ToNativeString(env, query)); - return true; + return NativeStat()->Search(jni::ToNativeString(env, query)); } } diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index eacc1cde21..c29d76b383 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -34,13 +34,10 @@ public enum Statistics private int mBookmarksCreated= 0; private int mSharedTimes = 0; - // Native statistics client - private final StatsClient client = new StatsClient(); - public void trackSearchQuery(final String query) { - client.trackSearchQuery(query); + StatsClient.trackSearchQuery(query); } private Statistics() diff --git a/android/src/com/mapswithme/util/statistics/StatsClient.java b/android/src/com/mapswithme/util/statistics/StatsClient.java index ba4dafaeab..6932ab10bd 100644 --- a/android/src/com/mapswithme/util/statistics/StatsClient.java +++ b/android/src/com/mapswithme/util/statistics/StatsClient.java @@ -2,5 +2,7 @@ package com.mapswithme.util.statistics; public class StatsClient { - public native boolean trackSearchQuery(String query); + public static native boolean trackSearchQuery(String query); + + private StatsClient() {} } diff --git a/omim_light.pro b/omim_light.pro deleted file mode 100644 index 89a8dc885f..0000000000 --- a/omim_light.pro +++ /dev/null @@ -1,34 +0,0 @@ -# Project that just includes all other projects, except 3party, publisher, sloynik. - -TEMPLATE = subdirs -CONFIG += ordered - -HEADERS += defines.hpp - -# desktop projects -win32|macx { -SUBDIRS = \ - base base/base_tests \ - coding coding/coding_tests \ - geometry \ - indexer \ - platform \ - stats \ - search search/search_tests \ - geometry/geometry_tests \ - platform/platform_tests \ - yg \ - storage storage/storage_tests \ - map map/map_tests map/benchmark_tool \ - generator generator/generator_tests \ - generator/generator_tool \ - qt_tstfrm \ - indexer/indexer_tests \ - yg/yg_tests \ - words words/words_tests \ - qt \ -} else { - # libraries which are used on iphone and bada - message = "Please use omim.pro for iphone builds" -} - diff --git a/stats/client/stats_client.cpp b/stats/client/stats_client.cpp index 1b1081b791..d0858090aa 100644 --- a/stats/client/stats_client.cpp +++ b/stats/client/stats_client.cpp @@ -23,12 +23,4 @@ bool Client::Search(string const & query) return m_writer->Write(s); } -bool Client::DropPin(long long latlong, string const & label) -{ - PinDrop p; - p.set_latlong(latlong); - p.set_label(label); - return m_writer->Write(p); -} - } // namespace stats diff --git a/stats/client/stats_client.hpp b/stats/client/stats_client.hpp index 0ffe0ffa6a..c313c78c5c 100644 --- a/stats/client/stats_client.hpp +++ b/stats/client/stats_client.hpp @@ -13,7 +13,6 @@ public: Client(); ~Client(); bool Search(string const & query); - bool DropPin(long long latlong, string const & label); private: StatsWriter * m_writer; diff --git a/stats/client/stats_writer.cpp b/stats/client/stats_writer.cpp index 2648d7022d..94e4286b05 100644 --- a/stats/client/stats_writer.cpp +++ b/stats/client/stats_writer.cpp @@ -8,8 +8,7 @@ namespace stats { StatsWriter::StatsWriter(string const & uniqueClientId, string const & dbPath) - : m_cnt(0), m_db(0), m_path(dbPath), - m_uid(0) + : m_cnt(0), m_db(0), m_path(dbPath), m_uid(0) { } diff --git a/stats/stats.pro b/stats/stats.pro index 7430bc38bc..5a2b7f0e0d 100644 --- a/stats/stats.pro +++ b/stats/stats.pro @@ -4,7 +4,3 @@ TEMPLATE = subdirs CONFIG += ordered SUBDIRS = client - -!iphone*:!bada*:!android* { - SUBDIRS += -}