Make use of templated XDP::ReadSetting
This commit is contained in:
parent
9bf89715b1
commit
ba73905c11
1 changed files with 8 additions and 14 deletions
|
|
@ -102,10 +102,9 @@ TitleControls::Layout TitleControlsLayout() {
|
||||||
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||||
|
|
||||||
const auto portalResult = []() -> std::optional<TitleControls::Layout> {
|
const auto portalResult = []() -> std::optional<TitleControls::Layout> {
|
||||||
try {
|
namespace XDP = base::Platform::XDP;
|
||||||
using namespace base::Platform::XDP;
|
|
||||||
|
|
||||||
const auto decorationLayout = ReadSetting(
|
const auto decorationLayout = XDP::ReadSetting<Glib::ustring>(
|
||||||
"org.gnome.desktop.wm.preferences",
|
"org.gnome.desktop.wm.preferences",
|
||||||
"button-layout");
|
"button-layout");
|
||||||
|
|
||||||
|
|
@ -114,12 +113,7 @@ TitleControls::Layout TitleControlsLayout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return GtkKeywordsToTitleControlsLayout(
|
return GtkKeywordsToTitleControlsLayout(
|
||||||
QString::fromStdString(
|
QString::fromStdString(*decorationLayout));
|
||||||
decorationLayout->get_dynamic<Glib::ustring>()));
|
|
||||||
} catch (...) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::nullopt;
|
|
||||||
}();
|
}();
|
||||||
|
|
||||||
if (portalResult.has_value()) {
|
if (portalResult.has_value()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue