forked from organicmaps/organicmaps
[eye] clang-format
This commit is contained in:
parent
c7e389f38c
commit
424354cf3d
6 changed files with 22 additions and 27 deletions
|
@ -7,9 +7,8 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_metrics_UserActionsLogger_nativeTipClicked(JNIEnv * env, jclass, jint type,
|
||||
jint event)
|
||||
JNIEXPORT void JNICALL Java_com_mapswithme_maps_metrics_UserActionsLogger_nativeTipClicked(
|
||||
JNIEnv * env, jclass, jint type, jint event)
|
||||
{
|
||||
auto const & typeValue = static_cast<eye::Tip::Type>(type);
|
||||
auto const & eventValue = static_cast<eye::Tip::Event>(event);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include "coding/file_writer.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
#include "base/assert.hpp"
|
||||
#include "base/logging.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
@ -50,7 +50,7 @@ bool Save(Info const & info)
|
|||
}
|
||||
|
||||
// TODO: use to trim old map object events.
|
||||
//bool SaveMapObjects(Info const & info)
|
||||
// bool SaveMapObjects(Info const & info)
|
||||
//{
|
||||
// std::vector<int8_t> fileData;
|
||||
// Serdes::SerializeMapObjects(info.m_mapObjects, fileData);
|
||||
|
@ -58,7 +58,7 @@ bool Save(Info const & info)
|
|||
//}
|
||||
//
|
||||
// TODO: use it to save map object events with append only flag.
|
||||
//bool SaveMapObjectEvent(MapObject const & mapObject, MapObject::Event const & event)
|
||||
// bool SaveMapObjectEvent(MapObject const & mapObject, MapObject::Event const & event)
|
||||
//{
|
||||
// std::vector<int8_t> eventData;
|
||||
// Serdes::SerializeMapObjectEvent(mapObject, event, eventData);
|
||||
|
@ -334,7 +334,7 @@ void Eye::Event::UgcEditorOpened()
|
|||
});
|
||||
}
|
||||
|
||||
//static
|
||||
// static
|
||||
void Eye::Event::UgcSaved()
|
||||
{
|
||||
GetPlatform().RunTask(Platform::Thread::File, []
|
||||
|
|
|
@ -12,16 +12,16 @@ namespace eye
|
|||
class Subscriber
|
||||
{
|
||||
public:
|
||||
virtual ~Subscriber() {};
|
||||
virtual ~Subscriber(){};
|
||||
|
||||
public:
|
||||
virtual void OnTipClicked(Tip const & tip) {};
|
||||
virtual void OnBookingFilterUsed(Time const & time) {};
|
||||
virtual void OnBookmarksCatalogShown(Time const & time) {};
|
||||
virtual void OnDiscoveryShown(Time const & time) {};
|
||||
virtual void OnDiscoveryItemClicked(Discovery::Event event) {};
|
||||
virtual void OnLayerUsed(Layer const & layer) {};
|
||||
virtual void OnPlacePageOpened(MapObject const & poi) {};
|
||||
virtual void OnTipClicked(Tip const & tip){};
|
||||
virtual void OnBookingFilterUsed(Time const & time){};
|
||||
virtual void OnBookmarksCatalogShown(Time const & time){};
|
||||
virtual void OnDiscoveryShown(Time const & time){};
|
||||
virtual void OnDiscoveryItemClicked(Discovery::Event event){};
|
||||
virtual void OnLayerUsed(Layer const & layer){};
|
||||
virtual void OnPlacePageOpened(MapObject const & poi){};
|
||||
};
|
||||
|
||||
// Note This class IS thread-safe.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include "base/visitor.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
|
@ -185,16 +185,14 @@ struct MapObject
|
|||
{
|
||||
size_t operator()(MapObject const & p) const
|
||||
{
|
||||
return base::Hash(
|
||||
base::Hash(p.m_pos.lat, p.m_pos.lon),
|
||||
base::Hash(p.m_bestType, p.m_bestType));
|
||||
return base::Hash(base::Hash(p.m_pos.lat, p.m_pos.lon),
|
||||
base::Hash(p.m_bestType, p.m_bestType));
|
||||
}
|
||||
};
|
||||
|
||||
bool operator==(MapObject const & rhs) const
|
||||
{
|
||||
return m_pos.EqualDxDy(rhs.m_pos, 1e-6) &&
|
||||
m_bestType == rhs.m_bestType;
|
||||
return m_pos.EqualDxDy(rhs.m_pos, 1e-6) && m_bestType == rhs.m_bestType;
|
||||
}
|
||||
|
||||
std::string m_bestType;
|
||||
|
|
|
@ -133,9 +133,8 @@ void Serdes::DeserializeMapObjects(std::vector<int8_t> const & bytes, MapObjects
|
|||
}
|
||||
catch (base::Json::Exception & ex)
|
||||
{
|
||||
LOG(LERROR, ("Cannot deserialize map objects. Exception:", ex.Msg(),
|
||||
". Event string:", eventString,
|
||||
". Content:", std::string(bytes.begin(), bytes.end())));
|
||||
LOG(LERROR, ("Cannot deserialize map objects. Exception:", ex.Msg(), ". Event string:",
|
||||
eventString, ". Content:", std::string(bytes.begin(), bytes.end())));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ Info MakeDefaultInfoForTesting()
|
|||
layer.m_type = Layer::Type::PublicTransport;
|
||||
info.m_layers.emplace_back(std::move(layer));
|
||||
|
||||
|
||||
info.m_discovery.m_lastOpenedTime = Time(std::chrono::hours(30000));
|
||||
info.m_discovery.m_eventCounters.Increment(Discovery::Event::MoreAttractionsClicked);
|
||||
info.m_discovery.m_lastClickedTime = Time(std::chrono::hours(30005));
|
||||
|
@ -83,8 +82,8 @@ void CompareWithDefaultInfo(Info const & lhs)
|
|||
auto const & lPoi = *(lhs.m_mapObjects.begin());
|
||||
auto const & rPoi = *(rhs.m_mapObjects.begin());
|
||||
TEST(lPoi.first.m_pos.EqualDxDy(rPoi.first.m_pos, 1e-6), ());
|
||||
TEST_EQUAL(lPoi.first.m_bestType, rPoi.first.m_bestType,());
|
||||
TEST_EQUAL(lPoi.second.size(), rPoi.second.size(),());
|
||||
TEST_EQUAL(lPoi.first.m_bestType, rPoi.first.m_bestType, ());
|
||||
TEST_EQUAL(lPoi.second.size(), rPoi.second.size(), ());
|
||||
TEST(lPoi.second[0].m_userPos.EqualDxDy(rPoi.second[0].m_userPos, 1e-6), ());
|
||||
TEST_EQUAL(lPoi.second[0].m_eventTime, rPoi.second[0].m_eventTime, ());
|
||||
TEST_EQUAL(lPoi.second[0].m_type, rPoi.second[0].m_type, ());
|
||||
|
|
Loading…
Add table
Reference in a new issue