[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:
parent
00a5baa3d9
commit
5ab01eba9f
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user