Delete cached box art when the host is deleted
This commit is contained in:
parent
5abf5a157d
commit
4408a3a354
3 changed files with 18 additions and 0 deletions
|
|
@ -87,6 +87,16 @@ QUrl BoxArtManager::loadBoxArt(NvComputer* computer, NvApp& app)
|
||||||
return QUrl("qrc:/res/no_app_image.png");
|
return QUrl("qrc:/res/no_app_image.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BoxArtManager::deleteBoxArt(NvComputer* computer)
|
||||||
|
{
|
||||||
|
QDir dir(Path::getBoxArtCacheDir());
|
||||||
|
|
||||||
|
// Delete everything in this computer's box art directory
|
||||||
|
if (dir.cd(computer->uuid)) {
|
||||||
|
dir.removeRecursively();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BoxArtManager::handleBoxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image)
|
void BoxArtManager::handleBoxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image)
|
||||||
{
|
{
|
||||||
if (!image.isEmpty()) {
|
if (!image.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ public:
|
||||||
QUrl
|
QUrl
|
||||||
loadBoxArt(NvComputer* computer, NvApp& app);
|
loadBoxArt(NvComputer* computer, NvApp& app);
|
||||||
|
|
||||||
|
static
|
||||||
|
void
|
||||||
|
deleteBoxArt(NvComputer* computer);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void
|
void
|
||||||
boxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image);
|
boxArtLoadComplete(NvComputer* computer, NvApp app, QUrl image);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "computermanager.h"
|
#include "computermanager.h"
|
||||||
|
#include "boxartmanager.h"
|
||||||
#include "nvhttp.h"
|
#include "nvhttp.h"
|
||||||
#include "settings/streamingpreferences.h"
|
#include "settings/streamingpreferences.h"
|
||||||
|
|
||||||
|
|
@ -399,6 +400,9 @@ public:
|
||||||
// Delete the polling entry first. This will stop all polling threads too.
|
// Delete the polling entry first. This will stop all polling threads too.
|
||||||
delete pollingEntry;
|
delete pollingEntry;
|
||||||
|
|
||||||
|
// Delete cached box art
|
||||||
|
BoxArtManager::deleteBoxArt(m_Computer);
|
||||||
|
|
||||||
// Finally, delete the computer itself. This must be done
|
// Finally, delete the computer itself. This must be done
|
||||||
// last because the polling thread might be using it.
|
// last because the polling thread might be using it.
|
||||||
delete m_Computer;
|
delete m_Computer;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue