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:
-rw-r--r--storage/diff_scheme/diff_manager.cpp17
-rw-r--r--storage/diff_scheme/diff_manager.hpp2
-rw-r--r--storage/storage.cpp14
3 files changed, 28 insertions, 5 deletions
diff --git a/storage/diff_scheme/diff_manager.cpp b/storage/diff_scheme/diff_manager.cpp
index d6dfcb63df..ce5fe7995a 100644
--- a/storage/diff_scheme/diff_manager.cpp
+++ b/storage/diff_scheme/diff_manager.cpp
@@ -51,8 +51,8 @@ void Manager::ApplyDiff(ApplyDiffParams && p, std::function<void(bool const resu
{
m_workerThread.Push([this, p, task]
{
- CHECK(p.m_diffFile, ());
- CHECK(p.m_oldMwmFile, ());
+ CHECK(p.m_diffFile, ("No diff at path:", p.m_diffFile->GetPath(MapOptions::Diff)));
+ CHECK(p.m_oldMwmFile, ("No old mwm at path:", p.m_oldMwmFile->GetPath(MapOptions::Map)));
auto & diffReadyPath = p.m_diffReadyPath;
auto & diffFile = p.m_diffFile;
@@ -147,5 +147,18 @@ bool Manager::IsPossibleToAutoupdate() const
}
return true;
}
+
+std::string DebugPrint(Status status)
+{
+ switch (status)
+ {
+ case Status::Undefined:
+ return "Undefined";
+ case Status::Available:
+ return "Available";
+ case Status::NotAvailable:
+ return "NotAvailable";
+ }
+}
} // namespace diffs
} // namespace storage
diff --git a/storage/diff_scheme/diff_manager.hpp b/storage/diff_scheme/diff_manager.hpp
index 0aa25f95ee..1e9c0a84d9 100644
--- a/storage/diff_scheme/diff_manager.hpp
+++ b/storage/diff_scheme/diff_manager.hpp
@@ -56,5 +56,7 @@ private:
base::ObserverListUnsafe<Observer> m_observers;
base::WorkerThread m_workerThread;
};
+
+std::string DebugPrint(Status status);
} // namespace diffs
} // namespace storage
diff --git a/storage/storage.cpp b/storage/storage.cpp
index 1fca6494ca..3df1370263 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -615,8 +615,11 @@ void Storage::DownloadNextCountryFromQueue()
{
OnMapDownloadFinished(countryId, false /* success */, queuedCountry.GetInitOptions());
NotifyStatusChangedForHierarchy(countryId);
- CorrectJustDownloadedAndQueue(m_queue.begin());
- DownloadNextCountryFromQueue();
+ if (!m_queue.empty())
+ {
+ CorrectJustDownloadedAndQueue(m_queue.begin());
+ DownloadNextCountryFromQueue();
+ }
return;
}
@@ -807,7 +810,10 @@ void Storage::OnServerListDownloaded(vector<string> const & urls)
break;
case Status::Available:
if (!m_diffManager.HasDiffFor(queuedCountry.GetCountryId()))
+ {
+ LOG(LINFO, ("No diff for the country:", queuedCountry.GetCountryId()));
queuedCountry.ResetToDefaultOptions();
+ }
break;
}
}
@@ -844,9 +850,10 @@ void Storage::RegisterDownloadedFiles(TCountryId const & countryId, MapOptions o
{
ASSERT_THREAD_CHECKER(m_threadChecker, ());
- auto const fn = [this, countryId](bool isSuccess)
+ auto const fn = [this, countryId, options](bool isSuccess)
{
ASSERT_THREAD_CHECKER(m_threadChecker, ());
+ LOG(LINFO, ("Process downloaded file:", countryId, "with option:", options));
if (!isSuccess)
{
OnDownloadFailed(countryId);
@@ -1470,6 +1477,7 @@ bool Storage::IsPossibleToAutoupdate() const
void Storage::OnDiffStatusReceived(diffs::Status const status)
{
+ LOG(LINFO, ("Received diff status:", status));
if (status != diffs::Status::NotAvailable)
{
for (auto const & localDiff : m_notAppliedDiffs)