Show PSM icons in backup manager.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "backupitem.h"
|
||||
#include "ui_backupitem.h"
|
||||
#include "utils.h"
|
||||
#include "dds.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
@@ -74,10 +75,17 @@ int BackupItem::getIconWidth()
|
||||
return ui->itemPicture->width();
|
||||
}
|
||||
|
||||
void BackupItem::setItemIcon(const QString path, int width)
|
||||
void BackupItem::setItemIcon(const QString path, int width, bool try_dds)
|
||||
{
|
||||
ui->itemPicture->setMinimumWidth(width);
|
||||
ui->itemPicture->setPixmap(QPixmap(path));
|
||||
QPixmap pixmap(path);
|
||||
if((pixmap.width() <= 0 || pixmap.height() <= 0) && try_dds) {
|
||||
QImage image;
|
||||
if(loadDDS(path, &image)) {
|
||||
pixmap = QPixmap::fromImage(image);
|
||||
}
|
||||
}
|
||||
ui->itemPicture->setPixmap(pixmap);
|
||||
}
|
||||
|
||||
bool BackupItem::lessThan(const BackupItem *s1, const BackupItem *s2)
|
||||
|
@@ -35,7 +35,7 @@ public:
|
||||
~BackupItem();
|
||||
|
||||
void setItemInfo(const QString name, const QString size);
|
||||
void setItemIcon(const QString path, int width = 48);
|
||||
void setItemIcon(const QString path, int width = 48, bool try_dds = false);
|
||||
void setDirectory(const QString path);
|
||||
const QPixmap *getIconPixmap();
|
||||
int getIconWidth();
|
||||
|
@@ -177,7 +177,7 @@ void BackupManagerForm::loadBackupListing(int index)
|
||||
}
|
||||
|
||||
item->setItemInfo(game_name, size);
|
||||
item->setItemIcon(QDir(parent_path).absoluteFilePath(sys_dir ? "icon0.png" : "ICON0.PNG"), img_width);
|
||||
item->setItemIcon(QDir(parent_path).absoluteFilePath(sys_dir ? "icon0.png" : "ICON0.PNG"), img_width, ohfi == VITA_OHFI_PSMAPP);
|
||||
item->setDirectory(obj->path + QDir::separator() + meta->name);
|
||||
item->resize(646, 70);
|
||||
|
||||
|
Reference in New Issue
Block a user