forked from organicmaps/organicmaps-tmp
adding map only after successful download.
This commit is contained in:
parent
ecd9957ac9
commit
3961393dc7
1 changed files with 18 additions and 14 deletions
|
@ -148,23 +148,27 @@ extern "C"
|
|||
break;
|
||||
};
|
||||
|
||||
FileToDownload & curFile = g_filesToDownload.back();
|
||||
|
||||
LOG(LDEBUG, ("finished downloading", curFile.m_fileName, "sized", curFile.m_fileSize, "bytes"));
|
||||
|
||||
/// slight hack, check manually for Maps extension and AddMap accordingly
|
||||
if (curFile.m_fileName.find(".mwm") != string::npos)
|
||||
if (errorCode == ERR_DOWNLOAD_SUCCESS)
|
||||
{
|
||||
LOG(LINFO, ("adding it as a map"));
|
||||
g_framework->AddMap(curFile.m_fileName);
|
||||
FileToDownload & curFile = g_filesToDownload.back();
|
||||
|
||||
|
||||
LOG(LDEBUG, ("finished downloading", curFile.m_fileName, "sized", curFile.m_fileSize, "bytes"));
|
||||
|
||||
/// slight hack, check manually for Maps extension and AddMap accordingly
|
||||
if (curFile.m_fileName.find(".mwm") != string::npos)
|
||||
{
|
||||
LOG(LINFO, ("adding it as a map"));
|
||||
g_framework->AddMap(curFile.m_fileName);
|
||||
}
|
||||
|
||||
g_totalDownloadedBytes += curFile.m_fileSize;
|
||||
|
||||
LOG(LDEBUG, ("totalDownloadedBytes:", g_totalDownloadedBytes));
|
||||
|
||||
g_filesToDownload.pop_back();
|
||||
}
|
||||
|
||||
g_totalDownloadedBytes += curFile.m_fileSize;
|
||||
|
||||
LOG(LDEBUG, ("totalDownloadedBytes:", g_totalDownloadedBytes));
|
||||
|
||||
g_filesToDownload.pop_back();
|
||||
|
||||
JNIEnv * env = jni::GetEnv();
|
||||
|
||||
jmethodID methodID = jni::GetJavaMethodID(env, *obj.get(), "onDownloadFinished", "(I)V");
|
||||
|
|
Loading…
Add table
Reference in a new issue