Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-04-19 17:45:26 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-04-19 18:53:47 +0300
commit589479a469875b9c8df8e2b66a08d7ac4823a03f (patch)
tree03307fee6ef9179b79970549a96b46b1276e05c7 /map/bookmark_manager.cpp
parente4d0e54d4f85911da942453dc8943b93c2421d2c (diff)
Fixed redundant notifications in BM
Diffstat (limited to 'map/bookmark_manager.cpp')
-rw-r--r--map/bookmark_manager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp
index f0bef32e33..db2402d548 100644
--- a/map/bookmark_manager.cpp
+++ b/map/bookmark_manager.cpp
@@ -586,6 +586,9 @@ void BookmarkManager::OnEditSessionClosed()
void BookmarkManager::NotifyChanges()
{
CHECK_THREAD_CHECKER(m_threadChecker, ());
+ if (!m_notificationsEnabled)
+ return;
+
if (!m_changesTracker.CheckChanges() && !m_firstDrapeNotification)
return;
@@ -1772,6 +1775,23 @@ void BookmarkManager::CancelCloudRestoring()
m_bookmarkCloud.CancelRestoring();
}
+void BookmarkManager::SetNotificationsEnabled(bool enabled)
+{
+ CHECK_THREAD_CHECKER(m_threadChecker, ());
+ if (m_notificationsEnabled == enabled)
+ return;
+
+ m_notificationsEnabled = enabled;
+ if (m_openedEditSessionsCount == 0)
+ NotifyChanges();
+}
+
+bool BookmarkManager::AreNotificationsEnabled() const
+{
+ CHECK_THREAD_CHECKER(m_threadChecker, ());
+ return m_notificationsEnabled;
+}
+
void BookmarkManager::EnableTestMode(bool enable)
{
UserMarkIdStorage::Instance().EnableTestMode(enable);