mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02: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
|
||||
|
||||
|
||||
+1
-1
Submodule Telegram/lib_base updated: 120b742f35...fbd025a28b
+1
-1
Submodule Telegram/lib_ui updated: 9bf89715b1...ba73905c11
Reference in New Issue
Block a user