From 07796c573a5d79961a94fc4242edd40afbd566fb Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 10 Mar 2016 16:48:14 +0300 Subject: [PATCH] [editor] HaveSomethingToUpload for specific mwm file. --- indexer/osm_editor.cpp | 14 ++++++++++++++ indexer/osm_editor.hpp | 1 + 2 files changed, 15 insertions(+) diff --git a/indexer/osm_editor.cpp b/indexer/osm_editor.cpp index d32119bee1..f84acf853e 100644 --- a/indexer/osm_editor.cpp +++ b/indexer/osm_editor.cpp @@ -510,6 +510,20 @@ bool Editor::HaveSomethingToUpload() const return false; } +bool Editor::HaveSomethingToUpload(MwmSet::MwmId const & mwmId) const +{ + auto const found = m_features.find(mwmId); + if (found != m_features.end()) + { + for (auto const & index : found->second) + { + if (NeedsUpload(index.second.m_uploadStatus)) + return true; + } + } + return false; +} + void Editor::UploadChanges(string const & key, string const & secret, TChangesetTags tags, TFinishUploadCallback callBack) { diff --git a/indexer/osm_editor.hpp b/indexer/osm_editor.hpp index 012606e847..b8cb174711 100644 --- a/indexer/osm_editor.hpp +++ b/indexer/osm_editor.hpp @@ -102,6 +102,7 @@ public: EditableProperties GetEditableProperties(FeatureType const & feature) const; bool HaveSomethingToUpload() const; + bool HaveSomethingToUpload(MwmSet::MwmId const & mwmId) const; using TChangesetTags = map; /// Tries to upload all local changes to OSM server in a separate thread. /// @param[in] tags should provide additional information about client to use in changeset.