Make use of templated XDP::ReadSetting

This commit is contained in:
Ilya Fedin 2023-09-18 15:54:59 +04:00 committed by John Preston
parent 9bf89715b1
commit ba73905c11

View file

@ -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()) {