mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Make use of templated XDP::ReadSetting
This commit is contained in:
@@ -465,18 +465,13 @@ QString SingleInstanceLocalServerName(const QString &hash) {
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||
std::optional<bool> IsDarkMode() {
|
||||
try {
|
||||
const auto result = base::Platform::XDP::ReadSetting(
|
||||
"org.freedesktop.appearance",
|
||||
"color-scheme");
|
||||
const auto result = base::Platform::XDP::ReadSetting<uint>(
|
||||
"org.freedesktop.appearance",
|
||||
"color-scheme");
|
||||
|
||||
if (result.has_value()) {
|
||||
return result->get_dynamic<uint>() == 1;
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
return result.has_value()
|
||||
? std::make_optional(*result == 1)
|
||||
: std::nullopt;
|
||||
}
|
||||
#endif // Qt < 6.5.0
|
||||
|
||||
|
Reference in New Issue
Block a user