[new downloader] Review fixes.

This commit is contained in:
Vladimir Byko-Ianko 2016-02-24 11:56:01 +03:00 committed by Sergey Yershov
parent 8458e3d125
commit b882d628e7
3 changed files with 7 additions and 6 deletions

View file

@ -197,8 +197,8 @@ Java_com_mapswithme_maps_downloader_MapManager_nativeListItems(JNIEnv * env, jcl
PutItemsToList(env, result, downloaded, parentId, ItemCategory::DOWNLOADED);
// All
TCountriesVec children;
storage.GetChildren(parentId, children);
TCountriesVec children(downloaded.begin(), downloaded.end());
children.insert(children.end(), available.begin(), available.end());
PutItemsToList(env, result, children, parentId, ItemCategory::ALL);
}
}

View file

@ -1166,7 +1166,7 @@ void Storage::GetChildrenInGroups(TCountryId const & parent,
child.ForEachDescendant([&](TCountriesContainer const & descendant)
{
TCountryId const & countryId = descendant.Value().Name();
if (HasCountryId(localMaps, countryId))
if (!hasDownloadedDescendant && HasCountryId(localMaps, countryId))
hasDownloadedDescendant = true;
});
if (hasDownloadedDescendant == true)

View file

@ -252,9 +252,10 @@ public:
/// If not, the mwm id the child will not be added to |availChildren|.
/// \param parent is a parent acoording to countries.txt or cournties_migrate.txt.
/// \param downloadedChildren children partly or fully downloaded.
/// \param availChildren fully available children. No of its mwms have been downloaded.
/// \note. This method puts to localChildren only real maps which have been written in coutries.txt or cournties_migrate.txt.
/// It means the method does not put to localChildren neither custom maps generated by user
/// \param availChildren fully available children. None of its files have been downloaded.
/// \note. This method puts to |downloadedChildren| and |availChildren| only real maps (and its ancestors)
/// which have been written in coutries.txt or cournties_migrate.txt.
/// It means the method does not put to its params neither custom maps generated by user
/// nor World.mwm and WorldCoasts.mwm.
void GetChildrenInGroups(TCountryId const & parent,
TCountriesVec & downloadedChildren, TCountriesVec & availChildren) const;