adding map only after successful download.

This commit is contained in:
rachytski 2012-05-21 17:46:54 +04:00 committed by Alex Zolotarev
parent ecd9957ac9
commit 3961393dc7

View file

@ -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");