xdgdesktopportal: Fallback to base theme if color scheme is unknown

This should be better than returning unknown if xdg-desktop-portal
is not running or its backend doesn't know color scheme

This also matches the pratice of all other
QXdgDesktopPortalTheme methods

Pick-to: 6.5
Change-Id: I352e091a019bc5b683c3f1dad223e55717888d02
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ilya Fedin 2023-05-29 19:06:48 +04:00
parent 8f0d2e2874
commit b3b6dd49ba

View File

@ -208,6 +208,8 @@ QVariant QXdgDesktopPortalTheme::themeHint(ThemeHint hint) const
Qt::ColorScheme QXdgDesktopPortalTheme::colorScheme() const
{
Q_D(const QXdgDesktopPortalTheme);
if (d->colorScheme == Qt::ColorScheme::Unknown)
return d->baseTheme->colorScheme();
return d->colorScheme;
}