Start: Cleanup and minor bugfixes
Start: Remove QML include Start: Eliminate errors on unreadable images Start: Ensure command succeeded Start: Correct startup WB Also re-enable the migrator, which was not the culprit. Gui: Roll back unneeded NoneWorkbench changes
This commit is contained in:
@@ -69,10 +69,12 @@ void FileCardDelegate::paint(QPainter* painter,
|
||||
auto pixmap = gsl::owner<QPixmap*>(new QPixmap());
|
||||
if (!image.isEmpty()) {
|
||||
pixmap->loadFromData(image);
|
||||
auto scaled = pixmap->scaled(QSize(thumbnailSize, thumbnailSize),
|
||||
Qt::AspectRatioMode::KeepAspectRatio,
|
||||
Qt::TransformationMode::SmoothTransformation);
|
||||
thumbnail->setPixmap(scaled);
|
||||
if (!pixmap->isNull()) {
|
||||
auto scaled = pixmap->scaled(QSize(thumbnailSize, thumbnailSize),
|
||||
Qt::AspectRatioMode::KeepAspectRatio,
|
||||
Qt::TransformationMode::SmoothTransformation);
|
||||
thumbnail->setPixmap(scaled);
|
||||
}
|
||||
}
|
||||
else {
|
||||
thumbnail->setPixmap(generateThumbnail(path));
|
||||
@@ -141,7 +143,9 @@ QPixmap FileCardDelegate::generateThumbnail(const QString& path) const
|
||||
// It is an image: it can be its own thumbnail
|
||||
QImageReader reader(path);
|
||||
auto image = reader.read();
|
||||
return pixmapToSizedQImage(image, thumbnailSize);
|
||||
if (!image.isNull()) {
|
||||
return pixmapToSizedQImage(image, thumbnailSize);
|
||||
}
|
||||
}
|
||||
QIcon icon = QFileIconProvider().icon(QFileInfo(path));
|
||||
if (!icon.isNull()) {
|
||||
|
||||
Reference in New Issue
Block a user