ax(mining): replace prose comments with usage examples in settings_manager
Three comments restated the function/type name in prose (AX principle 2 violation). Replaced with concrete call-site examples showing real usage. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
9a38c8d547
commit
ddfd62b8ce
1 changed files with 6 additions and 3 deletions
|
|
@ -58,7 +58,8 @@ type AppSettings struct {
|
|||
Theme string `json:"theme"` // "light", "dark", "system"
|
||||
}
|
||||
|
||||
// DefaultSettings returns sensible defaults for app settings
|
||||
// settings := DefaultSettings()
|
||||
// settings.Theme = "dark"
|
||||
func DefaultSettings() *AppSettings {
|
||||
return &AppSettings{
|
||||
Window: WindowState{
|
||||
|
|
@ -85,14 +86,16 @@ func DefaultSettings() *AppSettings {
|
|||
}
|
||||
}
|
||||
|
||||
// SettingsManager handles loading and saving app settings
|
||||
// sm, err := NewSettingsManager()
|
||||
// settings := sm.Get()
|
||||
type SettingsManager struct {
|
||||
mu sync.RWMutex
|
||||
settings *AppSettings
|
||||
settingsPath string
|
||||
}
|
||||
|
||||
// NewSettingsManager creates a new settings manager
|
||||
// sm, err := NewSettingsManager()
|
||||
// if err != nil { return err }
|
||||
func NewSettingsManager() (*SettingsManager, error) {
|
||||
settingsPath, err := xdg.ConfigFile(filepath.Join("lethean-desktop", settingsFileName))
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue