diff options
author | Ken Moore <ken@ixsystems.com> | 2019-01-25 08:07:49 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-01-25 08:07:49 -0500 |
commit | 2975db2e4085df87f15932ddf6ba5648fddfe586 (patch) | |
tree | a8b6bf59daae9d4dea58fd505da9824489b44b85 /src-qt5/desktop-utils/lumina-fm | |
parent | Fix pkg-plist for lumina-photo again. (diff) | |
download | lumina-2975db2e4085df87f15932ddf6ba5648fddfe586.tar.gz lumina-2975db2e4085df87f15932ddf6ba5648fddfe586.tar.bz2 lumina-2975db2e4085df87f15932ddf6ba5648fddfe586.zip |
Fix the usage of standard icons within the browser.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/Browser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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; |