Make use of templated XDP::ReadSetting
This commit is contained in:
parent
fd00450f44
commit
ea41aab713
|
@ -465,18 +465,13 @@ QString SingleInstanceLocalServerName(const QString &hash) {
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
std::optional<bool> IsDarkMode() {
|
std::optional<bool> IsDarkMode() {
|
||||||
try {
|
const auto result = base::Platform::XDP::ReadSetting<uint>(
|
||||||
const auto result = base::Platform::XDP::ReadSetting(
|
"org.freedesktop.appearance",
|
||||||
"org.freedesktop.appearance",
|
"color-scheme");
|
||||||
"color-scheme");
|
|
||||||
|
|
||||||
if (result.has_value()) {
|
return result.has_value()
|
||||||
return result->get_dynamic<uint>() == 1;
|
? std::make_optional(*result == 1)
|
||||||
}
|
: std::nullopt;
|
||||||
} catch (...) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
}
|
||||||
#endif // Qt < 6.5.0
|
#endif // Qt < 6.5.0
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 120b742f35a7ff07afc827fd19415f60c52cc0e6
|
Subproject commit fbd025a28bc25525f842a7a1934e112549e04b35
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9bf89715b14c87cab4605684cd73d335ce38d1a0
|
Subproject commit ba73905c117da8ba06de54c5d35a707603093815
|
Loading…
Reference in New Issue
Block a user