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
path: root/ugc
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-10-16 13:42:39 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2017-10-16 13:57:17 +0300
commit7008796b3f8b1c4a92092205777b782a5fc17b99 (patch)
treed24740fb4f724cbd1dc1c57730c2f9307dec29ec /ugc
parent4e15406cc2e14b94f32fc0a033e5732a0dc07d14 (diff)
Fixed UGC uploading
Diffstat (limited to 'ugc')
-rw-r--r--ugc/api.cpp10
-rw-r--r--ugc/api.hpp2
2 files changed, 12 insertions, 0 deletions
diff --git a/ugc/api.cpp b/ugc/api.cpp
index 3462bfdd81..7ea6954324 100644
--- a/ugc/api.cpp
+++ b/ugc/api.cpp
@@ -34,6 +34,11 @@ void Api::SendingCompleted()
m_thread.Push([this] { SendingCompletedImpl(); });
}
+void Api::SaveUGCOnDisk()
+{
+ m_thread.Push([this] { SaveUGCOnDiskImpl(); });
+}
+
void Api::GetUGCImpl(FeatureID const & id, UGCCallback callback)
{
if (!id.IsValid())
@@ -63,4 +68,9 @@ void Api::SendingCompletedImpl()
{
m_storage.MarkAllAsSynchronized();
}
+
+void Api::SaveUGCOnDiskImpl()
+{
+ m_storage.SaveIndex();
+}
} // namespace ugc
diff --git a/ugc/api.hpp b/ugc/api.hpp
index 5cccf84009..8eec8c54c5 100644
--- a/ugc/api.hpp
+++ b/ugc/api.hpp
@@ -25,12 +25,14 @@ public:
void SetUGCUpdate(FeatureID const & id, UGCUpdate const & ugc);
void GetUGCToSend(UGCJsonToSendCallback const & fn);
void SendingCompleted();
+ void SaveUGCOnDisk();
private:
void GetUGCImpl(FeatureID const & id, UGCCallback callback);
void SetUGCUpdateImpl(FeatureID const & id, UGCUpdate const & ugc);
void GetUGCToSendImpl(UGCJsonToSendCallback const & fn);
void SendingCompletedImpl();
+ void SaveUGCOnDiskImpl();
base::WorkerThread m_thread;
Storage m_storage;