aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-09-23 14:10:36 -0400
committerKen Moore <ken@pcbsd.org>2016-09-23 14:10:36 -0400
commitad90928c71f0d687b3141fdb9d275c7a2215055d (patch)
tree3e43ced28889d6ae877d0fb4817e96cd032011ca /src-qt5/core/lumina-desktop
parentFix the painting issue with the favorites area on the start menu with all the... (diff)
downloadlumina-ad90928c71f0d687b3141fdb9d275c7a2215055d.tar.gz
lumina-ad90928c71f0d687b3141fdb9d275c7a2215055d.tar.bz2
lumina-ad90928c71f0d687b3141fdb9d275c7a2215055d.zip
Add a fallback icon if an image file fails to load the thumbnail for desktop icons.
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index d1d6c7a8..b74bbcb3 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -58,7 +58,9 @@ void AppLauncherPlugin::loadButton(){
if(info.isDir()){
button->setIcon( LXDG::findIcon("folder","") );
}else if(LUtils::imageExtensions().contains(info.suffix().toLower()) ){
- button->setIcon( QIcon(QPixmap(path).scaled(256,256)) ); //max size for thumbnails in memory
+ QPixmap pix;
+ if(pix.load(path)){ button->setIcon( QIcon(pix.scaled(256,256)) ); } //max size for thumbnails in memory
+ else{ button->setIcon( LXDG::findIcon("dialog-cancel","") ); }
}else{
button->setIcon( QIcon(LXDG::findMimeIcon(path).pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
}
@@ -68,7 +70,7 @@ void AppLauncherPlugin::loadButton(){
}else{
//InValid File
button->setWhatsThis("");
- button->setIcon( QIcon(LXDG::findIcon("quickopen","").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
+ button->setIcon( QIcon(LXDG::findIcon("quickopen","dialog-cancel").pixmap(QSize(icosize,icosize)).scaledToHeight(icosize, Qt::SmoothTransformation) ) );
button->setText( tr("Click to Set") );
if(!watcher->files().isEmpty()){ watcher->removePaths(watcher->files()); }
}
bgstack15