mirror of https://github.com/procxx/kepka.git
Crash fix when setting a background image by URL. #3077
When we choose a file from URL we don't get the filename. In background image apply method we test for a theme / palette file extensions. Now we don't crash there, but we still can't set a .tdesktop-theme or .tdesktop-palette file from URL. Who cares :)
This commit is contained in:
parent
d254058690
commit
a5eb5a6ea2
|
@ -271,18 +271,20 @@ void BackgroundWidget::notifyFileQueryUpdated(const FileDialog::QueryUpdate &upd
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto filePath = update.filePaths.front();
|
if (!update.filePaths.isEmpty()) {
|
||||||
if (filePath.endsWith(qstr(".tdesktop-theme"), Qt::CaseInsensitive)
|
auto filePath = update.filePaths.front();
|
||||||
|| filePath.endsWith(qstr(".tdesktop-palette"), Qt::CaseInsensitive)) {
|
if (filePath.endsWith(qstr(".tdesktop-theme"), Qt::CaseInsensitive)
|
||||||
Window::Theme::Apply(filePath);
|
|| filePath.endsWith(qstr(".tdesktop-palette"), Qt::CaseInsensitive)) {
|
||||||
return;
|
Window::Theme::Apply(filePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage img;
|
QImage img;
|
||||||
if (!update.remoteContent.isEmpty()) {
|
if (!update.remoteContent.isEmpty()) {
|
||||||
img = App::readImage(update.remoteContent);
|
img = App::readImage(update.remoteContent);
|
||||||
} else {
|
} else {
|
||||||
img = App::readImage(filePath);
|
img = App::readImage(update.filePaths.front());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img.isNull() || img.width() <= 0 || img.height() <= 0) return;
|
if (img.isNull() || img.width() <= 0 || img.height() <= 0) return;
|
||||||
|
|
Loading…
Reference in New Issue