Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The preview image is not displayed in the properties window of the file in trash #2029

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,16 @@ void FilePropertyDialog::setFileIcon(QLabel *fileIcon, FileInfoPointer fileInfo)
if (!fileInfo.isNull()) {
ThumbnailHelper helper;
QUrl localUrl = fileInfo->urlOf(FileInfo::FileUrlInfoType::kUrl);
if (fileInfo->canAttributes(CanableInfoType::kCanRedirectionFileUrl))
localUrl = fileInfo->urlOf(UrlInfoType::kRedirectedFileUrl);
if (helper.checkThumbEnable(localUrl)) {
QImage img = helper.thumbnailImage(localUrl, ThumbnailSize::kLarge);
if (!img.isNull()) {
fileIcon->setPixmap(QPixmap::fromImage(img).scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
QIcon icon = fileInfo->extendAttributes(ExtInfoType::kFileThumbnail).value<QIcon>();
if (icon.isNull()) {
const auto &img = helper.thumbnailImage(localUrl, Global::kLarge);
icon = QPixmap::fromImage(img);
}
if (!icon.isNull()) {
fileIcon->setPixmap(icon.pixmap(128, 128).scaled(128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation));
return;
}
}
Expand Down
Loading