mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-30 19:15:08 +01:00
Make a scoped pointer from the thing retreived from the moodbar cache
This commit is contained in:
parent
51229b88c5
commit
f98d5e8fb6
@ -25,6 +25,8 @@
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QUrl>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
MoodbarLoader::MoodbarLoader(QObject* parent)
|
||||
: QObject(parent),
|
||||
cache_(new QNetworkDiskCache(this))
|
||||
@ -72,11 +74,10 @@ MoodbarLoader::Result MoodbarLoader::Load(
|
||||
}
|
||||
|
||||
// Maybe it exists in the cache?
|
||||
QIODevice* cache_device = cache_->data(url);
|
||||
boost::scoped_ptr<QIODevice> cache_device(cache_->data(url));
|
||||
if (cache_device) {
|
||||
qLog(Info) << "Loading cached moodbar data for" << filename;
|
||||
*data = cache_device->readAll();
|
||||
delete cache_device;
|
||||
return Loaded;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user