@@ -90,7 +90,7 @@ namespace noctalia::config::schema {
9090 field (&LockscreenConfig::blurredDesktop, " blurred_desktop" ),
9191 field (&LockscreenConfig::blurIntensity, " blur_intensity" , kUnitRange ),
9292 field (&LockscreenConfig::tintIntensity, " tint_intensity" , kUnitRange ),
93- field (&LockscreenConfig::wallpaper, " wallpaper" ),
93+ pathStringField (&LockscreenConfig::wallpaper, " wallpaper" ),
9494 field (&LockscreenConfig::monitors, " monitors" ),
9595 };
9696 return s;
@@ -401,7 +401,7 @@ namespace noctalia::config::schema {
401401 field (&DockConfig::showInstanceCount, " show_instance_count" ),
402402 enumField (&DockConfig::launcherPosition, " launcher_position" , kDockLauncherPositions ),
403403 field (&DockConfig::launcherIcon, " launcher_icon" ),
404- field (&DockConfig::launcherCustomImage, " launcher_custom_image" ),
404+ pathStringField (&DockConfig::launcherCustomImage, " launcher_custom_image" ),
405405 field (&DockConfig::launcherCustomImageColorize, " launcher_custom_image_colorize" ),
406406 field (&DockConfig::pinned, " pinned" ),
407407 field (&DockConfig::monitors, " monitors" ),
@@ -643,36 +643,6 @@ namespace noctalia::config::schema {
643643 );
644644 }
645645
646- // String holding a filesystem path: ~ and $VARS expand on read, emitted raw.
647- template <typename Struct> Field<Struct> pathStringField (std::string Struct::* member, std::string_view key) {
648- return custom<Struct>(
649- key,
650- [member, key](const toml::table& tbl, Struct& out, std::string_view, Diagnostics&) {
651- if (auto v = tbl[key].value <std::string>()) {
652- out.*member = v->empty () ? *v : FileUtils::expandUserPath (*v).string ();
653- }
654- },
655- [member, key](toml::table& tbl, const Struct& in) { tbl.insert_or_assign (key, in.*member); }
656- );
657- }
658-
659- template <typename Struct>
660- Field<Struct> optionalPathStringField (std::optional<std::string> Struct::* member, std::string_view key) {
661- return custom<Struct>(
662- key,
663- [member, key](const toml::table& tbl, Struct& out, std::string_view, Diagnostics&) {
664- if (auto v = tbl[key].value <std::string>()) {
665- out.*member = v->empty () ? *v : FileUtils::expandUserPath (*v).string ();
666- }
667- },
668- [member, key](toml::table& tbl, const Struct& in) {
669- if ((in.*member).has_value ()) {
670- tbl.insert_or_assign (key, *(in.*member));
671- }
672- }
673- );
674- }
675-
676646 template <typename Struct>
677647 Field<Struct> optionalBoolField (std::optional<bool > Struct::* member, std::string_view key) {
678648 return custom<Struct>(
0 commit comments