mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Make use of templated XDP::ReadSetting
This commit is contained in:
parent
fd00450f44
commit
ea41aab713
3 changed files with 8 additions and 13 deletions
|
@ -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 @@
|
|||
Subproject commit 120b742f35a7ff07afc827fd19415f60c52cc0e6
|
||||
Subproject commit fbd025a28bc25525f842a7a1934e112549e04b35
|
|
@ -1 +1 @@
|
|||
Subproject commit 9bf89715b14c87cab4605684cd73d335ce38d1a0
|
||||
Subproject commit ba73905c117da8ba06de54c5d35a707603093815
|
Loading…
Add table
Reference in a new issue