diff 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
line wrap: on
line diff
--- a/src/core/config.cc	Mon Jan 08 17:07:01 2024 -0500
+++ b/src/core/config.cc	Mon Jan 08 21:23:00 2024 -0500
@@ -93,7 +93,13 @@
 
 	theme.SetTheme(Translate::ToTheme(INI::GetIniValue<std::string>(ini, "Appearance", "Theme", "Default")));
 
-	library.paths = Strings::Split(INI::GetIniValue<std::string>(ini, "Library", "Folders", ""), ";");
+	{
+		std::vector<std::string> v = Strings::Split(INI::GetIniValue<std::string>(ini, "Library", "Folders", ""), ";");
+		library.paths = std::set(std::make_move_iterator(v.begin()),
+								 std::make_move_iterator(v.end()));
+	}
+
+	library.real_time_monitor = INI::GetIniValue<bool>(ini, "Library", "Real-time monitor", true);
 
 	return 0;
 }
@@ -137,6 +143,7 @@
 	}
 
 	INI::SetIniValue(ini, "Library", "Folders", Strings::Implode(library.paths, ";"));
+	INI::SetIniValue(ini, "Library", "Real-time monitor", library.real_time_monitor);
 
 	file.write(ini);