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
|
||||
|
||||
const auto portalResult = []() -> std::optional<TitleControls::Layout> {
|
||||
try {
|
||||
using namespace base::Platform::XDP;
|
||||
namespace XDP = base::Platform::XDP;
|
||||
|
||||
const auto decorationLayout = ReadSetting(
|
||||
const auto decorationLayout = XDP::ReadSetting<Glib::ustring>(
|
||||
"org.gnome.desktop.wm.preferences",
|
||||
"button-layout");
|
||||
|
||||
|
|
@ -114,12 +113,7 @@ TitleControls::Layout TitleControlsLayout() {
|
|||
}
|
||||
|
||||
return GtkKeywordsToTitleControlsLayout(
|
||||
QString::fromStdString(
|
||||
decorationLayout->get_dynamic<Glib::ustring>()));
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
QString::fromStdString(*decorationLayout));
|
||||
}();
|
||||
|
||||
if (portalResult.has_value()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue