From 5ab01eba9f0ba5e5ec73d8abd4f6c6af8927c057 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Apr 2018 11:26:43 -0400 Subject: [PATCH] [plasmalnf] Don't even try to load an empty filename for screenshot. - Avoid one attempt-to-load if the filename is empty, and one re-creating of the Pixmap. --- src/modules/plasmalnf/ThemeWidget.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/plasmalnf/ThemeWidget.cpp b/src/modules/plasmalnf/ThemeWidget.cpp index 125085db4..9f892c6d9 100644 --- a/src/modules/plasmalnf/ThemeWidget.cpp +++ b/src/modules/plasmalnf/ThemeWidget.cpp @@ -42,13 +42,8 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent) qMax(12 * CalamaresUtils::defaultFontHeight(), 120), qMax(8 * CalamaresUtils::defaultFontHeight(), 80) }; - QPixmap image( info.imagePath ); - if ( info.imagePath.isEmpty() ) - { - // Image can't possibly be valid - image = QPixmap( ":/view-preview.png" ); - } - else if ( image.isNull() ) + QPixmap image( info.imagePath.isEmpty() ? ":/view-preview.png" : info.imagePath ); + if ( image.isNull() ) { // Not found or not specified, so convert the name into some (horrible, likely) // color instead.