[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.
This commit is contained in:
Adriaan de Groot 2018-04-09 11:26:43 -04:00
parent 00a5baa3d9
commit 5ab01eba9f

View File

@ -42,13 +42,8 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
qMax(12 * CalamaresUtils::defaultFontHeight(), 120), qMax(12 * CalamaresUtils::defaultFontHeight(), 120),
qMax(8 * CalamaresUtils::defaultFontHeight(), 80) }; qMax(8 * CalamaresUtils::defaultFontHeight(), 80) };
QPixmap image( info.imagePath ); QPixmap image( info.imagePath.isEmpty() ? ":/view-preview.png" : info.imagePath );
if ( info.imagePath.isEmpty() ) if ( image.isNull() )
{
// Image can't possibly be valid
image = QPixmap( ":/view-preview.png" );
}
else if ( image.isNull() )
{ {
// Not found or not specified, so convert the name into some (horrible, likely) // Not found or not specified, so convert the name into some (horrible, likely)
// color instead. // color instead.