fixed removig of the copies of resources
This commit is contained in:
parent
6425338c35
commit
3f96f1effa
|
@ -69,8 +69,10 @@ IconData::IconData(const QString &url):
|
||||||
m_isDownloading = false;
|
m_isDownloading = false;
|
||||||
});
|
});
|
||||||
} else if(m_isResource) {
|
} else if(m_isResource) {
|
||||||
QFile file(url);
|
m_img = QImage(url);
|
||||||
file.copy(m_localUrl);
|
m_img.save(m_localUrl, "PNG");
|
||||||
|
s_localImageCache.insert(m_localUrl);
|
||||||
|
snoreDebug(SNORE_DEBUG) << m_localUrl << "added to cache";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,11 +99,11 @@ IconData::~IconData()
|
||||||
|
|
||||||
const QImage &IconData::image()
|
const QImage &IconData::image()
|
||||||
{
|
{
|
||||||
|
if (m_img.isNull()) {
|
||||||
while(m_isDownloading)
|
while(m_isDownloading)
|
||||||
{
|
{
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
}
|
}
|
||||||
if (m_img.isNull()) {
|
|
||||||
if (!m_isRemoteFile) {
|
if (!m_isRemoteFile) {
|
||||||
m_img = QImage(m_url);
|
m_img = QImage(m_url);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue