comparison src/core/config.cc @ 226:f784b5b1914c

settings: add library page
author Paper <mrpapersonic@gmail.com>
date Mon, 08 Jan 2024 21:23:00 -0500
parents 7ca56c4ac0bc
children d030b30526d5
comparison
equal deleted inserted replaced
225:56ea2bdc6724 226:f784b5b1914c
91 91
92 locale.SetActiveLocale(QLocale(Strings::ToQString(INI::GetIniValue<std::string>(ini, "General", "Locale", "en_US")))); 92 locale.SetActiveLocale(QLocale(Strings::ToQString(INI::GetIniValue<std::string>(ini, "General", "Locale", "en_US"))));
93 93
94 theme.SetTheme(Translate::ToTheme(INI::GetIniValue<std::string>(ini, "Appearance", "Theme", "Default"))); 94 theme.SetTheme(Translate::ToTheme(INI::GetIniValue<std::string>(ini, "Appearance", "Theme", "Default")));
95 95
96 library.paths = Strings::Split(INI::GetIniValue<std::string>(ini, "Library", "Folders", ""), ";"); 96 {
97 std::vector<std::string> v = Strings::Split(INI::GetIniValue<std::string>(ini, "Library", "Folders", ""), ";");
98 library.paths = std::set(std::make_move_iterator(v.begin()),
99 std::make_move_iterator(v.end()));
100 }
101
102 library.real_time_monitor = INI::GetIniValue<bool>(ini, "Library", "Real-time monitor", true);
97 103
98 return 0; 104 return 0;
99 } 105 }
100 106
101 int Config::Save() const { 107 int Config::Save() const {
135 break; 141 break;
136 } 142 }
137 } 143 }
138 144
139 INI::SetIniValue(ini, "Library", "Folders", Strings::Implode(library.paths, ";")); 145 INI::SetIniValue(ini, "Library", "Folders", Strings::Implode(library.paths, ";"));
146 INI::SetIniValue(ini, "Library", "Real-time monitor", library.real_time_monitor);
140 147
141 file.write(ini); 148 file.write(ini);
142 149
143 return 0; 150 return 0;
144 } 151 }