fixed deadlock

This commit is contained in:
Patrick von Reth 2014-01-18 16:26:34 +01:00
parent 98fbac1fa1
commit 9d711a2b0a

View File

@ -83,7 +83,6 @@ const QImage &IconData::image()
else else
{ {
download(); download();
m_img = QImage::fromData(m_data,"PNG");
} }
} }
return m_img; return m_img;
@ -91,10 +90,13 @@ const QImage &IconData::image()
QString IconData::localUrl() QString IconData::localUrl()
{ {
QMutexLocker lock(&m_mutex);
if(!m_isLocalFile && !QFile(m_localUrl).exists()) if(!m_isLocalFile && !QFile(m_localUrl).exists())
{ {
image().save(m_localUrl ,"PNG"); QImage img = image();
if(!QFile(m_localUrl).exists())
{
img.save(m_localUrl ,"PNG");
}
} }
return m_localUrl; return m_localUrl;
} }