From 2975db2e4085df87f15932ddf6ba5648fddfe586 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Fri, 25 Jan 2019 08:07:49 -0500 Subject: Fix the usage of standard icons within the browser. --- src-qt5/desktop-utils/lumina-fm/Browser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fm') diff --git a/src-qt5/desktop-utils/lumina-fm/Browser.cpp b/src-qt5/desktop-utils/lumina-fm/Browser.cpp index 34205880..3ebef38f 100644 --- a/src-qt5/desktop-utils/lumina-fm/Browser.cpp +++ b/src-qt5/desktop-utils/lumina-fm/Browser.cpp @@ -61,16 +61,18 @@ bool Browser::showingThumbnails(){ // PRIVATE void Browser::loadItem(QString info, Browser *obj){ - QImage* pix = new QImage(); + QImage* pix = 0; //this needs to return 0 if a standard icon is to be used if(imageFormats.contains(info.section(".",-1).toLower()) ){ QFile file(info); if(file.open(QIODevice::ReadOnly)){ QByteArray bytes = file.readAll(); file.close(); - pix->loadFromData(bytes); - if(pix->width() > 256 || pix->height() > 256 ){ - *pix = pix->scaled(256,256, Qt::KeepAspectRatio, Qt::FastTransformation); + QImage *tmppix = new QImage(); + tmppix->loadFromData(bytes); + if(tmppix->width() > 256 || tmppix->height() > 256 ){ + *pix = tmppix->scaled(256,256, Qt::KeepAspectRatio, Qt::FastTransformation); } + delete tmppix; } } //qDebug() << " - done with item:" << info; -- cgit