forked from organicmaps/organicmaps
Add UserStas interface to Framework.
This commit is contained in:
parent
d4dedb92dd
commit
fb3bcd534b
2 changed files with 26 additions and 3 deletions
|
@ -1432,7 +1432,7 @@ void Framework::FillSearchResultsMarks(search::Results const & results)
|
|||
if (r.GetResultType() == search::Result::RESULT_FEATURE)
|
||||
mark->SetFoundFeature(r.GetFeatureID());
|
||||
mark->SetMatchedName(r.GetString());
|
||||
|
||||
|
||||
if (r.m_metadata.m_isSponsoredHotel)
|
||||
mark->SetCustomSymbol("search-booking");
|
||||
}
|
||||
|
@ -1909,9 +1909,9 @@ void Framework::ActivateMapSelection(bool needAnimation, df::SelectionShape::ESe
|
|||
m_selectedFeature = info.GetID();
|
||||
CallDrapeFunction(bind(&df::DrapeEngine::SelectObject, _1, selectionType, info.GetMercator(),
|
||||
needAnimation));
|
||||
|
||||
|
||||
SetDisplacementMode(info.m_isSponsoredHotel ? dp::displacement::kHotelMode : dp::displacement::kDefaultMode);
|
||||
|
||||
|
||||
if (m_activateMapSelectionFn)
|
||||
m_activateMapSelectionFn(info);
|
||||
else
|
||||
|
@ -2882,3 +2882,12 @@ bool Framework::RollBackChanges(FeatureID const & fid)
|
|||
}
|
||||
return rolledBack;
|
||||
}
|
||||
|
||||
bool Framework::UpdateUserStats(string const & userName)
|
||||
{
|
||||
auto newUserStats = make_unique<editor::UserStats>(userName);
|
||||
if (!newUserStats->GetUpdateStatus())
|
||||
return false;
|
||||
m_userStats.reset(newUserStats.release());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "indexer/map_style.hpp"
|
||||
#include "indexer/new_feature_categories.hpp"
|
||||
|
||||
#include "editor/user_stats.hpp"
|
||||
|
||||
#include "search/query_saver.hpp"
|
||||
#include "search/search_engine.hpp"
|
||||
|
||||
|
@ -671,5 +673,17 @@ private:
|
|||
routing::RouterType m_currentRouterType;
|
||||
//@}
|
||||
|
||||
public:
|
||||
//@{
|
||||
//User statistics.
|
||||
editor::UserStats const * GetUserStats() const { return m_userStats.get(); }
|
||||
/// Synchronously request the server and updates users stats.
|
||||
/// @returns true on success.
|
||||
bool UpdateUserStats(string const & userName);
|
||||
|
||||
private:
|
||||
unique_ptr<editor::UserStats> m_userStats;
|
||||
//@}
|
||||
|
||||
DECLARE_THREAD_CHECKER(m_threadChecker);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue