Changed: Fix issue with table background images not displaying

--HG--
branch : develop
This commit is contained in:
Nimetu 2017-07-23 21:37:42 +03:00
parent 36f5ee7f83
commit e35195252f

View file

@ -450,6 +450,19 @@ namespace NLGUI
{ {
string finalUrl = upgradeInsecureUrl(getAbsoluteUrl(url)); string finalUrl = upgradeInsecureUrl(getAbsoluteUrl(url));
// use requested url for local name (cache)
string dest = localImageName(url);
#ifdef LOG_DL
nlwarning("add to download '%s' dest '%s' img %p", finalUrl.c_str(), dest.c_str(), img);
#endif
// Display cached image while downloading new
if (type != TImageType::OverImage && CFile::fileExists(dest))
{
setImage(img, dest, type);
setImageSize(img, style);
}
// Search if we are not already downloading this url. // Search if we are not already downloading this url.
for(uint i = 0; i < Curls.size(); i++) for(uint i = 0; i < Curls.size(); i++)
{ {
@ -463,12 +476,6 @@ namespace NLGUI
} }
} }
// use requested url for local name (cache)
string dest = localImageName(url);
#ifdef LOG_DL
nlwarning("add to download '%s' dest '%s' img %p", finalUrl.c_str(), dest.c_str(), img);
#endif
Curls.push_back(CDataDownload(finalUrl, dest, ImgType, img, "", "", style, type)); Curls.push_back(CDataDownload(finalUrl, dest, ImgType, img, "", "", style, type));
if (Curls.size() < options.curlMaxConnections) { if (Curls.size() < options.curlMaxConnections) {
if (!startCurlDownload(Curls.back())) if (!startCurlDownload(Curls.back()))