MCPcopy Create free account
hub / github.com/SolarLune/masterplan / SaveSettings

Function SaveSettings

settings.go:276–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274}
275
276func SaveSettings() {
277
278 path, _ := xdg.ConfigFile(SettingsPath)
279
280 saveData, _ := sjson.Set("{}", "version", globals.Version.String())
281
282 saveData, _ = sjson.SetRaw(saveData, "properties", globals.Settings.Serialize(false))
283
284 saveData, _ = sjson.Set(saveData, "recent files", globals.RecentFiles)
285
286 saveData, _ = sjson.SetRaw(saveData, "keybindings", globals.Keybindings.Serialize())
287
288 saveData = gjson.Get(saveData, "@pretty").String()
289
290 if file, err := os.Create(path); err != nil {
291 log.Println(err)
292 } else {
293 file.Write([]byte(saveData))
294 file.Close()
295 }
296
297}
298
299// func (ps *OldProgramSettings) CleanUpRecentPlanList() {
300

Callers 3

AddFileToRecentFilesListFunction · 0.85
NewProgramSettingsFunction · 0.85
ConstructMenusFunction · 0.85

Calls 6

SetRawMethod · 0.80
CloseMethod · 0.80
SetMethod · 0.45
StringMethod · 0.45
SerializeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected