@@ -35,6 +35,7 @@ class PathSetting : public Setting<Disengageable, std::filesystem::path>
3535 using SettingBase::onChange_;
3636 using SettingBase::reset;
3737 using SettingBase::help;
38+ using SettingBase::value;
3839 using SettingBase::observeEngagedToBool;
3940
4041 PathSetting (
@@ -66,13 +67,26 @@ class PathSetting : public Setting<Disengageable, std::filesystem::path>
6667 },
6768 [this ](std::optional<std::vector<std::filesystem::path>> results)
6869 {
70+ // Print results:
71+ if (results)
72+ {
73+ for (const auto & path : *results)
74+ {
75+ Log::info (" Selected path: {}" , path.string ());
76+ }
77+ }
78+ else
79+ {
80+ Log::info (" Dialog was closed without selecting a path." );
81+ }
82+
6983 if (!results) // The dialog was closed without selecting a file
7084 return ;
7185 if (results->empty ()) // nothing was selected, but the dialog was closed with ok.
7286 return ;
7387
7488 // Use the first selected path
75- state_ = results->at (0 ). string ( );
89+ SettingBase::value ( results->at (0 ));
7690 Nui::globalEventContext.executeActiveEventsImmediately ();
7791 onChange_ ();
7892 }
@@ -96,7 +110,7 @@ class PathSetting : public Setting<Disengageable, std::filesystem::path>
96110 return ;
97111
98112 // Use the first selected path
99- state_ = results->at (0 ). string ( );
113+ SettingBase::value ( results->at (0 ));
100114 Nui::globalEventContext.executeActiveEventsImmediately ();
101115 onChange_ ();
102116 }
@@ -120,7 +134,7 @@ class PathSetting : public Setting<Disengageable, std::filesystem::path>
120134 .value = stateWithInheritance_,
121135 .attributes = {observeEngagedToBool (disabled)},
122136 .onChange = [this ](auto const & state, Nui::WebApi::Event const &){
123- this -> value (std::filesystem::path{state});
137+ SettingBase:: value (std::filesystem::path{state});
124138 onChange_ ();
125139 },
126140 .dontUpdateValue = true ,
0 commit comments