fixed removig of the copies of resources

This commit is contained in:
Patrick von Reth 2014-09-22 15:26:14 +02:00
parent 6425338c35
commit 3f96f1effa
1 changed files with 8 additions and 6 deletions

View File

@ -69,8 +69,10 @@ IconData::IconData(const QString &url):
m_isDownloading = false;
});
} else if(m_isResource) {
QFile file(url);
file.copy(m_localUrl);
m_img = QImage(url);
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()
{
while(m_isDownloading)
{
qApp->processEvents();
}
if (m_img.isNull()) {
while(m_isDownloading)
{
qApp->processEvents();
}
if (!m_isRemoteFile) {
m_img = QImage(m_url);
}